Skip to content

ComputeOptimizerClient

Index > ComputeOptimizer > ComputeOptimizerClient

Auto-generated documentation for ComputeOptimizer type annotations stubs module types-aiobotocore-compute-optimizer.

ComputeOptimizerClient

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

Usage example
from aioboto3.session import Session
from types_aiobotocore_compute_optimizer.client import ComputeOptimizerClient

session = Session()
async with session.client("compute-optimizer") as client:
    client: ComputeOptimizerClient

Exceptions

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

Usage example
async with session.client("compute-optimizer") as client:
    try:
        do_something(client)
    except (
            client.AccessDeniedException,
        client.ClientError,
        client.InternalServerException,
        client.InvalidParameterValueException,
        client.LimitExceededException,
        client.MissingAuthenticationToken,
        client.OptInRequiredException,
        client.ResourceNotFoundException,
        client.ServiceUnavailableException,
        client.ThrottlingException,
    ) as e:
        print(e)
Type checking example
from types_aiobotocore_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 session.client("compute-optimizer").can_paginate method. boto3 documentation

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

close

Closes underlying endpoint connections.

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

Method definition
await def close(
    self,
) -> None:
    ...

delete_recommendation_preferences

Deletes a recommendation preference, such as enhanced infrastructure metrics.

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

Method definition
await 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
Usage example with kwargs
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 session.client("compute-optimizer").describe_recommendation_export_jobs method. boto3 documentation

Method definition
await 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
Usage example with kwargs
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 session.client("compute-optimizer").export_auto_scaling_group_recommendations method. boto3 documentation

Method definition
await 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
Usage example with kwargs
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 session.client("compute-optimizer").export_ebs_volume_recommendations method. boto3 documentation

Method definition
await 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
Usage example with kwargs
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 session.client("compute-optimizer").export_ec2_instance_recommendations method. boto3 documentation

Method definition
await 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
Usage example with kwargs
kwargs: ExportEC2InstanceRecommendationsRequestRequestTypeDef = {  # (1)
    "s3DestinationConfig": ...,
}

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

export_lambda_function_recommendations

Exports optimization recommendations for Lambda functions.

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

Method definition
await 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
Usage example with kwargs
kwargs: ExportLambdaFunctionRecommendationsRequestRequestTypeDef = {  # (1)
    "s3DestinationConfig": ...,
}

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

generate_presigned_url

Generate a presigned url given a client, its method, and arguments.

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

Method definition
await def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

get_auto_scaling_group_recommendations

Returns Auto Scaling group recommendations.

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

Method definition
await def get_auto_scaling_group_recommendations(
    self,
    *,
    accountIds: Sequence[str] = ...,
    autoScalingGroupArns: Sequence[str] = ...,
    nextToken: str = ...,
    maxResults: int = ...,
    filters: Sequence[FilterTypeDef] = ...,  # (1)
    recommendationPreferences: RecommendationPreferencesTypeDef = ...,  # (2)
) -> GetAutoScalingGroupRecommendationsResponseTypeDef:  # (3)
    ...
  1. See FilterTypeDef
  2. See RecommendationPreferencesTypeDef
  3. See GetAutoScalingGroupRecommendationsResponseTypeDef
Usage example with kwargs
kwargs: GetAutoScalingGroupRecommendationsRequestRequestTypeDef = {  # (1)
    "accountIds": ...,
}

parent.get_auto_scaling_group_recommendations(**kwargs)
  1. See GetAutoScalingGroupRecommendationsRequestRequestTypeDef

get_ebs_volume_recommendations

Returns Amazon Elastic Block Store (Amazon EBS) volume recommendations.

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

Method definition
await def get_ebs_volume_recommendations(
    self,
    *,
    volumeArns: Sequence[str] = ...,
    nextToken: str = ...,
    maxResults: int = ...,
    filters: Sequence[EBSFilterTypeDef] = ...,  # (1)
    accountIds: Sequence[str] = ...,
) -> GetEBSVolumeRecommendationsResponseTypeDef:  # (2)
    ...
  1. See EBSFilterTypeDef
  2. See GetEBSVolumeRecommendationsResponseTypeDef
Usage example with kwargs
kwargs: GetEBSVolumeRecommendationsRequestRequestTypeDef = {  # (1)
    "volumeArns": ...,
}

parent.get_ebs_volume_recommendations(**kwargs)
  1. See GetEBSVolumeRecommendationsRequestRequestTypeDef

get_ec2_instance_recommendations

Returns Amazon EC2 instance recommendations.

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

Method definition
await def get_ec2_instance_recommendations(
    self,
    *,
    instanceArns: Sequence[str] = ...,
    nextToken: str = ...,
    maxResults: int = ...,
    filters: Sequence[FilterTypeDef] = ...,  # (1)
    accountIds: Sequence[str] = ...,
    recommendationPreferences: RecommendationPreferencesTypeDef = ...,  # (2)
) -> GetEC2InstanceRecommendationsResponseTypeDef:  # (3)
    ...
  1. See FilterTypeDef
  2. See RecommendationPreferencesTypeDef
  3. See GetEC2InstanceRecommendationsResponseTypeDef
Usage example with kwargs
kwargs: GetEC2InstanceRecommendationsRequestRequestTypeDef = {  # (1)
    "instanceArns": ...,
}

parent.get_ec2_instance_recommendations(**kwargs)
  1. See GetEC2InstanceRecommendationsRequestRequestTypeDef

get_ec2_recommendation_projected_metrics

Returns the projected utilization metrics of Amazon EC2 instance recommendations.

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

Method definition
await def get_ec2_recommendation_projected_metrics(
    self,
    *,
    instanceArn: str,
    stat: MetricStatisticType,  # (1)
    period: int,
    startTime: Union[datetime, str],
    endTime: Union[datetime, str],
    recommendationPreferences: RecommendationPreferencesTypeDef = ...,  # (2)
) -> GetEC2RecommendationProjectedMetricsResponseTypeDef:  # (3)
    ...
  1. See MetricStatisticType
  2. See RecommendationPreferencesTypeDef
  3. See GetEC2RecommendationProjectedMetricsResponseTypeDef
Usage example with kwargs
kwargs: GetEC2RecommendationProjectedMetricsRequestRequestTypeDef = {  # (1)
    "instanceArn": ...,
    "stat": ...,
    "period": ...,
    "startTime": ...,
    "endTime": ...,
}

parent.get_ec2_recommendation_projected_metrics(**kwargs)
  1. See GetEC2RecommendationProjectedMetricsRequestRequestTypeDef

get_effective_recommendation_preferences

Returns the recommendation preferences that are in effect for a given resource, such as enhanced infrastructure metrics.

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

Method definition
await def get_effective_recommendation_preferences(
    self,
    *,
    resourceArn: str,
) -> GetEffectiveRecommendationPreferencesResponseTypeDef:  # (1)
    ...
  1. See GetEffectiveRecommendationPreferencesResponseTypeDef
Usage example with kwargs
kwargs: GetEffectiveRecommendationPreferencesRequestRequestTypeDef = {  # (1)
    "resourceArn": ...,
}

parent.get_effective_recommendation_preferences(**kwargs)
  1. See GetEffectiveRecommendationPreferencesRequestRequestTypeDef

get_enrollment_status

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

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

Method definition
await def get_enrollment_status(
    self,
) -> GetEnrollmentStatusResponseTypeDef:  # (1)
    ...
  1. See GetEnrollmentStatusResponseTypeDef

get_enrollment_statuses_for_organization

Returns the Compute Optimizer enrollment (opt-in) status of organization member accounts, if your account is an organization management account.

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

Method definition
await def get_enrollment_statuses_for_organization(
    self,
    *,
    filters: Sequence[EnrollmentFilterTypeDef] = ...,  # (1)
    nextToken: str = ...,
    maxResults: int = ...,
) -> GetEnrollmentStatusesForOrganizationResponseTypeDef:  # (2)
    ...
  1. See EnrollmentFilterTypeDef
  2. See GetEnrollmentStatusesForOrganizationResponseTypeDef
Usage example with kwargs
kwargs: GetEnrollmentStatusesForOrganizationRequestRequestTypeDef = {  # (1)
    "filters": ...,
}

parent.get_enrollment_statuses_for_organization(**kwargs)
  1. See GetEnrollmentStatusesForOrganizationRequestRequestTypeDef

get_lambda_function_recommendations

Returns Lambda function recommendations.

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

Method definition
await def get_lambda_function_recommendations(
    self,
    *,
    functionArns: Sequence[str] = ...,
    accountIds: Sequence[str] = ...,
    filters: Sequence[LambdaFunctionRecommendationFilterTypeDef] = ...,  # (1)
    nextToken: str = ...,
    maxResults: int = ...,
) -> GetLambdaFunctionRecommendationsResponseTypeDef:  # (2)
    ...
  1. See LambdaFunctionRecommendationFilterTypeDef
  2. See GetLambdaFunctionRecommendationsResponseTypeDef
Usage example with kwargs
kwargs: GetLambdaFunctionRecommendationsRequestRequestTypeDef = {  # (1)
    "functionArns": ...,
}

parent.get_lambda_function_recommendations(**kwargs)
  1. See GetLambdaFunctionRecommendationsRequestRequestTypeDef

get_recommendation_preferences

Returns existing recommendation preferences, such as enhanced infrastructure metrics.

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

Method definition
await def get_recommendation_preferences(
    self,
    *,
    resourceType: ResourceTypeType,  # (1)
    scope: ScopeTypeDef = ...,  # (2)
    nextToken: str = ...,
    maxResults: int = ...,
) -> GetRecommendationPreferencesResponseTypeDef:  # (3)
    ...
  1. See ResourceTypeType
  2. See ScopeTypeDef
  3. See GetRecommendationPreferencesResponseTypeDef
Usage example with kwargs
kwargs: GetRecommendationPreferencesRequestRequestTypeDef = {  # (1)
    "resourceType": ...,
}

parent.get_recommendation_preferences(**kwargs)
  1. See GetRecommendationPreferencesRequestRequestTypeDef

get_recommendation_summaries

Returns the optimization findings for an account.

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

Method definition
await def get_recommendation_summaries(
    self,
    *,
    accountIds: Sequence[str] = ...,
    nextToken: str = ...,
    maxResults: int = ...,
) -> GetRecommendationSummariesResponseTypeDef:  # (1)
    ...
  1. See GetRecommendationSummariesResponseTypeDef
Usage example with kwargs
kwargs: GetRecommendationSummariesRequestRequestTypeDef = {  # (1)
    "accountIds": ...,
}

parent.get_recommendation_summaries(**kwargs)
  1. See GetRecommendationSummariesRequestRequestTypeDef

put_recommendation_preferences

Creates a new recommendation preference or updates an existing recommendation preference, such as enhanced infrastructure metrics.

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

Method definition
await def put_recommendation_preferences(
    self,
    *,
    resourceType: ResourceTypeType,  # (1)
    scope: ScopeTypeDef = ...,  # (2)
    enhancedInfrastructureMetrics: EnhancedInfrastructureMetricsType = ...,  # (3)
    inferredWorkloadTypes: InferredWorkloadTypesPreferenceType = ...,  # (4)
) -> Dict[str, Any]:
    ...
  1. See ResourceTypeType
  2. See ScopeTypeDef
  3. See EnhancedInfrastructureMetricsType
  4. See InferredWorkloadTypesPreferenceType
Usage example with kwargs
kwargs: PutRecommendationPreferencesRequestRequestTypeDef = {  # (1)
    "resourceType": ...,
}

parent.put_recommendation_preferences(**kwargs)
  1. See PutRecommendationPreferencesRequestRequestTypeDef

update_enrollment_status

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

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

Method definition
await def update_enrollment_status(
    self,
    *,
    status: StatusType,  # (1)
    includeMemberAccounts: bool = ...,
) -> UpdateEnrollmentStatusResponseTypeDef:  # (2)
    ...
  1. See StatusType
  2. See UpdateEnrollmentStatusResponseTypeDef
Usage example with kwargs
kwargs: UpdateEnrollmentStatusRequestRequestTypeDef = {  # (1)
    "status": ...,
}

parent.update_enrollment_status(**kwargs)
  1. See UpdateEnrollmentStatusRequestRequestTypeDef

__aenter__

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

Method definition
await def __aenter__(
    self,
) -> ComputeOptimizerClient:
    ...

__aexit__

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

Method definition
await def __aexit__(
    self,
    exc_type: Any,
    exc_val: Any,
    exc_tb: Any,
) -> Any:
    ...