Skip to content

ComputeOptimizerClient#

Index > ComputeOptimizer > ComputeOptimizerClient

Auto-generated documentation for ComputeOptimizer type annotations stubs module mypy-boto3-compute-optimizer.

ComputeOptimizerClient#

Type annotations and code completion for boto3.client("compute-optimizer"). boto3 documentation

# ComputeOptimizerClient usage example

from boto3.session import Session
from mypy_boto3_compute_optimizer.client import ComputeOptimizerClient

def get_compute-optimizer_client() -> ComputeOptimizerClient:
    return Session().client("compute-optimizer")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("compute-optimizer").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("compute-optimizer")

try:
    do_something(client)
except (
    client.exceptions.AccessDeniedException,
    client.exceptions.ClientError,
    client.exceptions.InternalServerException,
    client.exceptions.InvalidParameterValueException,
    client.exceptions.LimitExceededException,
    client.exceptions.MissingAuthenticationToken,
    client.exceptions.OptInRequiredException,
    client.exceptions.ResourceNotFoundException,
    client.exceptions.ServiceUnavailableException,
    client.exceptions.ThrottlingException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_compute_optimizer.client import Exceptions

def handle_error(exc: Exceptions.AccessDeniedException) -> None:
    ...

Methods#

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("compute-optimizer").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("compute-optimizer").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

delete_recommendation_preferences#

Deletes a recommendation preference, such as enhanced infrastructure metrics.

Type annotations and code completion for boto3.client("compute-optimizer").delete_recommendation_preferences method. boto3 documentation

# delete_recommendation_preferences method definition

def delete_recommendation_preferences(
    self,
    *,
    resourceType: ResourceTypeType,  # (1)
    recommendationPreferenceNames: Sequence[RecommendationPreferenceNameType],  # (2)
    scope: ScopeTypeDef = ...,  # (3)
) -> Dict[str, Any]:
    ...
  1. See ResourceTypeType
  2. See RecommendationPreferenceNameType
  3. See ScopeTypeDef
# delete_recommendation_preferences method usage example with argument unpacking

kwargs: DeleteRecommendationPreferencesRequestRequestTypeDef = {  # (1)
    "resourceType": ...,
    "recommendationPreferenceNames": ...,
}

parent.delete_recommendation_preferences(**kwargs)
  1. See DeleteRecommendationPreferencesRequestRequestTypeDef

describe_recommendation_export_jobs#

Describes recommendation export jobs created in the last seven days.

Type annotations and code completion for boto3.client("compute-optimizer").describe_recommendation_export_jobs method. boto3 documentation

# describe_recommendation_export_jobs method definition

def describe_recommendation_export_jobs(
    self,
    *,
    jobIds: Sequence[str] = ...,
    filters: Sequence[JobFilterTypeDef] = ...,  # (1)
    nextToken: str = ...,
    maxResults: int = ...,
) -> DescribeRecommendationExportJobsResponseTypeDef:  # (2)
    ...
  1. See JobFilterTypeDef
  2. See DescribeRecommendationExportJobsResponseTypeDef
# describe_recommendation_export_jobs method usage example with argument unpacking

kwargs: DescribeRecommendationExportJobsRequestRequestTypeDef = {  # (1)
    "jobIds": ...,
}

parent.describe_recommendation_export_jobs(**kwargs)
  1. See DescribeRecommendationExportJobsRequestRequestTypeDef

export_auto_scaling_group_recommendations#

Exports optimization recommendations for Auto Scaling groups.

Type annotations and code completion for boto3.client("compute-optimizer").export_auto_scaling_group_recommendations method. boto3 documentation

# export_auto_scaling_group_recommendations method definition

def export_auto_scaling_group_recommendations(
    self,
    *,
    s3DestinationConfig: S3DestinationConfigTypeDef,  # (1)
    accountIds: Sequence[str] = ...,
    filters: Sequence[FilterTypeDef] = ...,  # (2)
    fieldsToExport: Sequence[ExportableAutoScalingGroupFieldType] = ...,  # (3)
    fileFormat: FileFormatType = ...,  # (4)
    includeMemberAccounts: bool = ...,
    recommendationPreferences: RecommendationPreferencesTypeDef = ...,  # (5)
) -> ExportAutoScalingGroupRecommendationsResponseTypeDef:  # (6)
    ...
  1. See S3DestinationConfigTypeDef
  2. See FilterTypeDef
  3. See ExportableAutoScalingGroupFieldType
  4. See FileFormatType
  5. See RecommendationPreferencesTypeDef
  6. See ExportAutoScalingGroupRecommendationsResponseTypeDef
# export_auto_scaling_group_recommendations method usage example with argument unpacking

kwargs: ExportAutoScalingGroupRecommendationsRequestRequestTypeDef = {  # (1)
    "s3DestinationConfig": ...,
}

parent.export_auto_scaling_group_recommendations(**kwargs)
  1. See ExportAutoScalingGroupRecommendationsRequestRequestTypeDef

export_ebs_volume_recommendations#

Exports optimization recommendations for Amazon EBS volumes.

Type annotations and code completion for boto3.client("compute-optimizer").export_ebs_volume_recommendations method. boto3 documentation

# export_ebs_volume_recommendations method definition

def export_ebs_volume_recommendations(
    self,
    *,
    s3DestinationConfig: S3DestinationConfigTypeDef,  # (1)
    accountIds: Sequence[str] = ...,
    filters: Sequence[EBSFilterTypeDef] = ...,  # (2)
    fieldsToExport: Sequence[ExportableVolumeFieldType] = ...,  # (3)
    fileFormat: FileFormatType = ...,  # (4)
    includeMemberAccounts: bool = ...,
) -> ExportEBSVolumeRecommendationsResponseTypeDef:  # (5)
    ...
  1. See S3DestinationConfigTypeDef
  2. See EBSFilterTypeDef
  3. See ExportableVolumeFieldType
  4. See FileFormatType
  5. See ExportEBSVolumeRecommendationsResponseTypeDef
# export_ebs_volume_recommendations method usage example with argument unpacking

kwargs: ExportEBSVolumeRecommendationsRequestRequestTypeDef = {  # (1)
    "s3DestinationConfig": ...,
}

parent.export_ebs_volume_recommendations(**kwargs)
  1. See ExportEBSVolumeRecommendationsRequestRequestTypeDef

export_ec2_instance_recommendations#

Exports optimization recommendations for Amazon EC2 instances.

Type annotations and code completion for boto3.client("compute-optimizer").export_ec2_instance_recommendations method.