Class: AWS.ComputeOptimizer

Inherits:
AWS.Service show all
Identifier:
computeoptimizer
API Version:
2019-11-01
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

AWS Compute Optimizer is a service that analyzes the configuration and utilization metrics of your AWS resources, such as EC2 instances and Auto Scaling groups. It reports whether your resources are optimal, and generates optimization recommendations to reduce the cost and improve the performance of your workloads. Compute Optimizer also provides recent utilization metric data, as well as projected utilization metric data for the recommendations, which you can use to evaluate which recommendation provides the best price-performance trade-off. The analysis of your usage patterns can help you decide when to move or resize your running resources, and still meet your performance and capacity requirements. For more information about Compute Optimizer, see the AWS Compute Optimizer User Guide.

Sending a Request Using ComputeOptimizer

var computeoptimizer = new AWS.ComputeOptimizer();
computeoptimizer.getAutoScalingGroupRecommendations(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the ComputeOptimizer object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var computeoptimizer = new AWS.ComputeOptimizer({apiVersion: '2019-11-01'});

You can also set the API version globally in AWS.config.apiVersions using the computeoptimizer service identifier:

AWS.config.apiVersions = {
  computeoptimizer: '2019-11-01',
  // other service API versions
};

var computeoptimizer = new AWS.ComputeOptimizer();

Version:

  • 2019-11-01

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.ComputeOptimizer(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a ComputeOptimizer object

var computeoptimizer = new AWS.ComputeOptimizer({apiVersion: '2019-11-01'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.ComputeOptimizer.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.ComputeOptimizer.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.ComputeOptimizer.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

getAutoScalingGroupRecommendations(params = {}, callback) ⇒ AWS.Request

Returns Auto Scaling group recommendations.

AWS Compute Optimizer currently generates recommendations for Auto Scaling groups that are configured to run instances of the M, C, R, T, and X instance families. The service does not generate recommendations for Auto Scaling groups that have a scaling policy attached to them, or that do not have the same values for desired, minimum, and maximum capacity. In order for Compute Optimizer to analyze your Auto Scaling groups, they must be of a fixed size. For more information, see the AWS Compute Optimizer User Guide.

Examples:

Calling the getAutoScalingGroupRecommendations operation

var params = {
  accountIds: [
    'STRING_VALUE',
    /* more items */
  ],
  autoScalingGroupArns: [
    'STRING_VALUE',
    /* more items */
  ],
  filters: [
    {
      name: Finding | RecommendationSourceType,
      values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    /* more items */
  ],
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
computeoptimizer.getAutoScalingGroupRecommendations(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • accountIds — (Array<String>)

      The AWS account IDs for which to return Auto Scaling group recommendations.

      Only one account ID can be specified per request.

    • autoScalingGroupArns — (Array<String>)

      The Amazon Resource Name (ARN) of the Auto Scaling groups for which to return recommendations.

    • nextToken — (String)

      The token to advance to the next page of Auto Scaling group recommendations.

    • maxResults — (Integer)

      The maximum number of Auto Scaling group recommendations to return with a single call.

      To retrieve the remaining results, make another call with the returned NextToken value.

    • filters — (Array<map>)

      An array of objects that describe a filter that returns a more specific list of Auto Scaling group recommendations.

      • name — (String)

        The name of the filter.

        Specify Finding to filter the results to a specific findings classification.

        Specify RecommendationSourceType to filter the results to a specific resource type.

        Possible values include:
        • "Finding"
        • "RecommendationSourceType"
      • values — (Array<String>)

        The value of the filter.

        If you specify the name parameter as Finding, and you're recommendations for an instance, then the valid values are Underprovisioned, Overprovisioned, NotOptimized, or Optimized.

        If you specify the name parameter as Finding, and you're recommendations for an Auto Scaling group, then the valid values are Optimized, or NotOptimized.

        If you specify the name parameter as RecommendationSourceType, then the valid values are EC2Instance, or AutoScalingGroup.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • nextToken — (String)

        The token to use to advance to the next page of Auto Scaling group recommendations.

        This value is null when there are no more pages of Auto Scaling group recommendations to return.

      • autoScalingGroupRecommendations — (Array<map>)

        An array of objects that describe Auto Scaling group recommendations.

        • accountId — (String)

          The AWS account ID of the Auto Scaling group.

        • autoScalingGroupArn — (String)

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

        • autoScalingGroupName — (String)

          The name of the Auto Scaling group.

        • finding — (String)

          The finding classification for the Auto Scaling group.

          Findings for Auto Scaling groups include:

          • NotOptimized —An Auto Scaling group is considered not optimized when AWS 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.

          Note: The values that are returned might be NOT_OPTIMIZED or OPTIMIZED.
          Possible values include:
          • "Underprovisioned"
          • "Overprovisioned"
          • "Optimized"
          • "NotOptimized"
        • utilizationMetrics — (Array<map>)

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

          • name — (String)

            The name of the utilization metric.

            Note: Memory metrics are only returned for resources that have the unified CloudWatch agent installed on them. For more information, see Enabling Memory Utilization with the CloudWatch Agent.
            Possible values include:
            • "Cpu"
            • "Memory"
          • statistic — (String)

            The statistic of the utilization metric.

            Possible values include:
            • "Maximum"
            • "Average"
          • value — (Float)

            The value of the utilization metric.

        • lookBackPeriodInDays — (Float)

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

        • currentConfiguration — (map)

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

          • desiredCapacity — (Integer)

            The desired capacity, or number of instances, for the Auto Scaling group.

          • minSize — (Integer)

            The minimum size, or minimum number of instances, for the Auto Scaling group.

          • maxSize — (Integer)

            The maximum size, or maximum number of instances, for the Auto Scaling group.

          • instanceType — (String)

            The instance type for the Auto Scaling group.

        • recommendationOptions — (Array<map>)

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

          • configuration — (map)

            An array of objects that describe an Auto Scaling group configuration.

            • desiredCapacity — (Integer)

              The desired capacity, or number of instances, for the Auto Scaling group.

            • minSize — (Integer)

              The minimum size, or minimum number of instances, for the Auto Scaling group.

            • maxSize — (Integer)

              The maximum size, or maximum number of instances, for the Auto Scaling group.

            • instanceType — (String)

              The instance type for the Auto Scaling group.

          • projectedUtilizationMetrics — (Array<map>)

            An array of objects that describe the projected utilization metrics of the Auto Scaling group recommendation option.

            • name — (String)

              The name of the utilization metric.

              Note: Memory metrics are only returned for resources that have the unified CloudWatch agent installed on them. For more information, see Enabling Memory Utilization with the CloudWatch Agent.
              Possible values include:
              • "Cpu"
              • "Memory"
            • statistic — (String)

              The statistic of the utilization metric.

              Possible values include:
              • "Maximum"
              • "Average"
            • value — (Float)

              The value of the utilization metric.

          • performanceRisk — (Float)

            The performance risk of the Auto Scaling group configuration recommendation.

            Performance risk is the likelihood of the recommended instance type not meeting the performance requirement of your workload.

            The lowest performance risk is categorized as 0, and the highest as 5.

          • rank — (Integer)

            The rank of the Auto Scaling group recommendation option.

            The top recommendation option is ranked as 1.

        • lastRefreshTimestamp — (Date)

          The time stamp of when the Auto Scaling group recommendation was last refreshed.

      • errors — (Array<map>)

        An array of objects that describe errors of the request.

        For example, an error is returned if you request recommendations for an unsupported Auto Scaling group.

        • identifier — (String)

          The ID of the error.

        • code — (String)

          The error code.

        • message — (String)

          The message, or reason, for the error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getEC2InstanceRecommendations(params = {}, callback) ⇒ AWS.Request

Returns Amazon EC2 instance recommendations.

AWS Compute Optimizer currently generates recommendations for Amazon Elastic Compute Cloud (Amazon EC2) and Amazon EC2 Auto Scaling. It generates recommendations for M, C, R, T, and X instance families. For more information, see the AWS Compute Optimizer User Guide.

Service Reference:

Examples:

Calling the getEC2InstanceRecommendations operation

var params = {
  accountIds: [
    'STRING_VALUE',
    /* more items */
  ],
  filters: [
    {
      name: Finding | RecommendationSourceType,
      values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    /* more items */
  ],
  instanceArns: [
    'STRING_VALUE',
    /* more items */
  ],
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
computeoptimizer.getEC2InstanceRecommendations(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • instanceArns — (Array<String>)

      The Amazon Resource Name (ARN) of the instances for which to return recommendations.

    • nextToken — (String)

      The token to advance to the next page of instance recommendations.

    • maxResults — (Integer)

      The maximum number of instance recommendations to return with a single call.

      To retrieve the remaining results, make another call with the returned NextToken value.

    • filters — (Array<map>)

      An array of objects that describe a filter that returns a more specific list of instance recommendations.

      • name — (String)

        The name of the filter.

        Specify Finding to filter the results to a specific findings classification.

        Specify RecommendationSourceType to filter the results to a specific resource type.

        Possible values include:
        • "Finding"
        • "RecommendationSourceType"
      • values — (Array<String>)

        The value of the filter.

        If you specify the name parameter as Finding, and you're recommendations for an instance, then the valid values are Underprovisioned, Overprovisioned, NotOptimized, or Optimized.

        If you specify the name parameter as Finding, and you're recommendations for an Auto Scaling group, then the valid values are Optimized, or NotOptimized.

        If you specify the name parameter as RecommendationSourceType, then the valid values are EC2Instance, or AutoScalingGroup.

    • accountIds — (Array<String>)

      The AWS account IDs for which to return instance recommendations.

      Only one account ID can be specified per request.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • nextToken — (String)

        The token to use to advance to the next page of instance recommendations.

        This value is null when there are no more pages of instance recommendations to return.

      • instanceRecommendations — (Array<map>)

        An array of objects that describe instance recommendations.

        • instanceArn — (String)

          The Amazon Resource Name (ARN) of the current instance.

        • accountId — (String)

          The AWS account ID of the instance recommendation.

        • instanceName — (String)

          The name of the current instance.

        • currentInstanceType — (String)

          The instance type of the current instance.

        • finding — (String)

          The finding classification for the instance.

          Findings for instances include:

          • Underprovisioned —An instance is considered under-provisioned when at least one specification of your instance, such as CPU, memory, or network, does not meet the performance requirements of your workload. Under-provisioned instances may lead to poor application performance.

          • Overprovisioned —An instance is considered over-provisioned when at least one specification of your instance, such as CPU, memory, or network, can be sized down while still meeting the performance requirements of your workload, and no specification is under-provisioned. Over-provisioned instances may lead to unnecessary infrastructure cost.

          • Optimized —An instance is considered optimized when all specifications of your instance, such as CPU, memory, and network, meet the performance requirements of your workload and is not over provisioned. An optimized instance runs your workloads with optimal performance and infrastructure cost. For optimized resources, AWS Compute Optimizer might recommend a new generation instance type.

          Note: The values that are returned might be UNDER_PROVISIONED, OVER_PROVISIONED, or OPTIMIZED.
          Possible values include:
          • "Underprovisioned"
          • "Overprovisioned"
          • "Optimized"
          • "NotOptimized"
        • utilizationMetrics — (Array<map>)

          An array of objects that describe the utilization metrics of the instance.

          • name — (String)

            The name of the utilization metric.

            Note: Memory metrics are only returned for resources that have the unified CloudWatch agent installed on them. For more information, see Enabling Memory Utilization with the CloudWatch Agent.
            Possible values include:
            • "Cpu"
            • "Memory"
          • statistic — (String)

            The statistic of the utilization metric.

            Possible values include:
            • "Maximum"
            • "Average"
          • value — (Float)

            The value of the utilization metric.

        • lookBackPeriodInDays — (Float)

          The number of days for which utilization metrics were analyzed for the instance.

        • recommendationOptions — (Array<map>)

          An array of objects that describe the recommendation options for the instance.

          • instanceType — (String)

            The instance type of the instance recommendation.

          • projectedUtilizationMetrics — (Array<map>)

            An array of objects that describe the projected utilization metrics of the instance recommendation option.

            • name — (String)

              The name of the utilization metric.

              Note: Memory metrics are only returned for resources that have the unified CloudWatch agent installed on them. For more information, see Enabling Memory Utilization with the CloudWatch Agent.
              Possible values include:
              • "Cpu"
              • "Memory"
            • statistic — (String)

              The statistic of the utilization metric.

              Possible values include:
              • "Maximum"
              • "Average"
            • value — (Float)

              The value of the utilization metric.

          • performanceRisk — (Float)

            The performance risk of the instance recommendation option.

            Performance risk is the likelihood of the recommended instance type not meeting the performance requirement of your workload.

            The lowest performance risk is categorized as 0, and the highest as 5.

          • rank — (Integer)

            The rank of the instance recommendation option.

            The top recommendation option is ranked as 1.

        • recommendationSources — (Array<map>)

          An array of objects that describe the source resource of the recommendation.

          • recommendationSourceArn — (String)

            The Amazon Resource Name (ARN) of the recommendation source.

          • recommendationSourceType — (String)

            The resource type of the recommendation source.

            Possible values include:
            • "Ec2Instance"
            • "AutoScalingGroup"
        • lastRefreshTimestamp — (Date)

          The time stamp of when the instance recommendation was last refreshed.

      • errors — (Array<map>)

        An array of objects that describe errors of the request.

        For example, an error is returned if you request recommendations for an instance of an unsupported instance family.

        • identifier — (String)

          The ID of the error.

        • code — (String)

          The error code.

        • message — (String)

          The message, or reason, for the error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getEC2RecommendationProjectedMetrics(params = {}, callback) ⇒ AWS.Request

Returns the projected utilization metrics of Amazon EC2 instance recommendations.

Examples:

Calling the getEC2RecommendationProjectedMetrics operation

var params = {
  endTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
  instanceArn: 'STRING_VALUE', /* required */
  period: 'NUMBER_VALUE', /* required */
  startTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
  stat: Maximum | Average /* required */
};
computeoptimizer.getEC2RecommendationProjectedMetrics(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • instanceArn — (String)

      The Amazon Resource Name (ARN) of the instances for which to return recommendation projected metrics.

    • stat — (String)

      The statistic of the projected metrics.

      Possible values include:
      • "Maximum"
      • "Average"
    • period — (Integer)

      The granularity, in seconds, of the projected metrics data points.

    • startTime — (Date)

      The time stamp of the first projected metrics data point to return.

    • endTime — (Date)

      The time stamp of the last projected metrics data point to return.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • recommendedOptionProjectedMetrics — (Array<map>)

        An array of objects that describe a projected metrics.

        • recommendedInstanceType — (String)

          The recommended instance type.

        • rank — (Integer)

          The rank of the recommendation option projected metric.

          The top recommendation option is ranked as 1.

          The projected metric rank correlates to the recommendation option rank. For example, the projected metric ranked as 1 is related to the recommendation option that is also ranked as 1 in the same response.

        • projectedMetrics — (Array<map>)

          An array of objects that describe a projected utilization metric.

          • name — (String)

            The name of the projected utilization metric.

            Note: Memory metrics are only returned for resources that have the unified CloudWatch agent installed on them. For more information, see Enabling Memory Utilization with the CloudWatch Agent.
            Possible values include:
            • "Cpu"
            • "Memory"
          • timestamps — (Array<Date>)

            The time stamps of the projected utilization metric.

          • values — (Array<Float>)

            The values of the projected utilization metrics.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getEnrollmentStatus(params = {}, callback) ⇒ AWS.Request

Returns the enrollment (opt in) status of an account to the AWS Compute Optimizer service.

If the account is a master account of an organization, this operation also confirms the enrollment status of member accounts within the organization.

Service Reference:

Examples:

Calling the getEnrollmentStatus operation

var params = {
};
computeoptimizer.getEnrollmentStatus(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • status — (String)

        The enrollment status of the account.

        Possible values include:
        • "Active"
        • "Inactive"
        • "Pending"
        • "Failed"
      • statusReason — (String)

        The reason for the enrollment status of the account.

        For example, an account might show a status of Pending because member accounts of an organization require more time to be enrolled in the service.

      • memberAccountsEnrolled — (Boolean)

        Confirms the enrollment status of member accounts within the organization, if the account is a master account of an organization.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getRecommendationSummaries(params = {}, callback) ⇒ AWS.Request

Returns the optimization findings for an account.

For example, it returns the number of Amazon EC2 instances in an account that are under-provisioned, over-provisioned, or optimized. It also returns the number of Auto Scaling groups in an account that are not optimized, or optimized.

Service Reference:

Examples:

Calling the getRecommendationSummaries operation

var params = {
  accountIds: [
    'STRING_VALUE',
    /* more items */
  ],
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
computeoptimizer.getRecommendationSummaries(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • accountIds — (Array<String>)

      The AWS account IDs for which to return recommendation summaries.

      Only one account ID can be specified per request.

    • nextToken — (String)

      The token to advance to the next page of recommendation summaries.

    • maxResults — (Integer)

      The maximum number of recommendation summaries to return with a single call.

      To retrieve the remaining results, make another call with the returned NextToken value.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • nextToken — (String)

        The token to use to advance to the next page of recommendation summaries.

        This value is null when there are no more pages of recommendation summaries to return.

      • recommendationSummaries — (Array<map>)

        An array of objects that summarize a recommendation.

        • summaries — (Array<map>)

          An array of objects that describe a recommendation summary.

          • name — (String)

            The finding classification of the recommendation.

            Possible values include:
            • "Underprovisioned"
            • "Overprovisioned"
            • "Optimized"
            • "NotOptimized"
          • value — (Float)

            The value of the recommendation summary.

        • recommendationResourceType — (String)

          The resource type of the recommendation.

          Possible values include:
          • "Ec2Instance"
          • "AutoScalingGroup"
        • accountId — (String)

          The AWS account ID of the recommendation summary.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateEnrollmentStatus(params = {}, callback) ⇒ AWS.Request

Updates the enrollment (opt in) status of an account to the AWS Compute Optimizer service.

If the account is a master account of an organization, this operation can also enroll member accounts within the organization.

Service Reference:

Examples:

Calling the updateEnrollmentStatus operation

var params = {
  status: Active | Inactive | Pending | Failed, /* required */
  includeMemberAccounts: true || false
};
computeoptimizer.updateEnrollmentStatus(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • status — (String)

      The new enrollment status of the account.

      Accepted options are Active or Inactive. You will get an error if Pending or Failed are specified.

      Possible values include:
      • "Active"
      • "Inactive"
      • "Pending"
      • "Failed"
    • includeMemberAccounts — (Boolean)

      Indicates whether to enroll member accounts within the organization, if the account is a master account of an organization.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • status — (String)

        The enrollment status of the account.

        Possible values include:
        • "Active"
        • "Inactive"
        • "Pending"
        • "Failed"
      • statusReason — (String)

        The reason for the enrollment status of the account. For example, an account might show a status of Pending because member accounts of an organization require more time to be enrolled in the service.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.