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. boto3 documentation

# export_ec2_instance_recommendations method definition

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

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

parent.export_ec2_instance_recommendations(**kwargs)
  1. See ExportEC2InstanceRecommendationsRequestRequestTypeDef

export_ecs_service_recommendations#

Exports optimization recommendations for Amazon ECS services on Fargate.

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

# export_ecs_service_recommendations method definition

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

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

parent.export_ecs_service_recommendations(**kwargs)
  1. See ExportECSServiceRecommendationsRequestRequestTypeDef

export_lambda_function_recommendations#

Exports optimization recommendations for Lambda functions.

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

# export_lambda_function_recommendations method definition

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

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

parent.export_lambda_function_recommendations(**kwargs)
  1. See ExportLambdaFunctionRecommendationsRequestRequestTypeDef

export_license_recommendations#

Export optimization recommendations for your licenses.

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

# export_license_recommendations method definition

def export_license_recommendations(
    self,
    *,
    s3DestinationConfig: S3DestinationConfigTypeDef,  # (1)
    accountIds: Sequence[str] = ...,
    filters: Sequence[LicenseRecommendationFilterTypeDef] = ...,  # (2)
    fieldsToExport: Sequence[ExportableLicenseFieldType] = ...,  # (3)
    fileFormat: FileFormatType = ...,  # (4)
    includeMemberAccounts: bool = ...,
) -> ExportLicenseRecommendationsResponseTypeDef:  # (5)
    ...
  1. See S3DestinationConfigTypeDef
  2. See LicenseRecommendationFilterTypeDef
  3. See ExportableLicenseFieldType
  4. See