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
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.
client = boto3.client("compute-optimizer")
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)
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
close
Closes underlying endpoint connections.
Type annotations and code completion for boto3.client("compute-optimizer").close
method.
boto3 documentation
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
def delete_recommendation_preferences(
self,
*,
resourceType: ResourceTypeType, # (1)
recommendationPreferenceNames: Sequence[RecommendationPreferenceNameType], # (2)
scope: ScopeTypeDef = ..., # (3)
) -> Dict[str, Any]:
...
kwargs: DeleteRecommendationPreferencesRequestRequestTypeDef = { # (1)
"resourceType": ...,
"recommendationPreferenceNames": ...,
}
parent.delete_recommendation_preferences(**kwargs)
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
def describe_recommendation_export_jobs(
self,
*,
jobIds: Sequence[str] = ...,
filters: Sequence[JobFilterTypeDef] = ..., # (1)
nextToken: str = ...,
maxResults: int = ...,
) -> DescribeRecommendationExportJobsResponseTypeDef: # (2)
...
kwargs: DescribeRecommendationExportJobsRequestRequestTypeDef = { # (1)
"jobIds": ...,
}
parent.describe_recommendation_export_jobs(**kwargs)
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
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)
...
- See S3DestinationConfigTypeDef
- See FilterTypeDef
- See ExportableAutoScalingGroupFieldType
- See FileFormatType
- See RecommendationPreferencesTypeDef
- See ExportAutoScalingGroupRecommendationsResponseTypeDef
kwargs: ExportAutoScalingGroupRecommendationsRequestRequestTypeDef = { # (1)
"s3DestinationConfig": ...,
}
parent.export_auto_scaling_group_recommendations(**kwargs)
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
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)
...
- See S3DestinationConfigTypeDef
- See EBSFilterTypeDef
- See ExportableVolumeFieldType
- See FileFormatType
- See ExportEBSVolumeRecommendationsResponseTypeDef
kwargs: ExportEBSVolumeRecommendationsRequestRequestTypeDef = { # (1)
"s3DestinationConfig": ...,
}
parent.export_ebs_volume_recommendations(**kwargs)
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
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)
...
- See S3DestinationConfigTypeDef
- See FilterTypeDef
- See ExportableInstanceFieldType
- See FileFormatType
- See RecommendationPreferencesTypeDef
- See ExportEC2InstanceRecommendationsResponseTypeDef
kwargs: ExportEC2InstanceRecommendationsRequestRequestTypeDef = { # (1)
"s3DestinationConfig": ...,
}
parent.export_ec2_instance_recommendations(**kwargs)
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
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)
...
- See S3DestinationConfigTypeDef
- See ECSServiceRecommendationFilterTypeDef
- See ExportableECSServiceFieldType
- See FileFormatType
- See ExportECSServiceRecommendationsResponseTypeDef
kwargs: ExportECSServiceRecommendationsRequestRequestTypeDef = { # (1)
"s3DestinationConfig": ...,
}
parent.export_ecs_service_recommendations(**kwargs)
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
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)
...
- See S3DestinationConfigTypeDef
- See LambdaFunctionRecommendationFilterTypeDef
- See ExportableLambdaFunctionFieldType
- See FileFormatType
- See ExportLambdaFunctionRecommendationsResponseTypeDef
kwargs: ExportLambdaFunctionRecommendationsRequestRequestTypeDef = { # (1)
"s3DestinationConfig": ...,
}
parent.export_lambda_function_recommendations(**kwargs)
generate_presigned_url
Generate a presigned url given a client, its method, and arguments.
Type annotations and code completion for boto3.client("compute-optimizer").generate_presigned_url
method.
boto3 documentation
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 boto3.client("compute-optimizer").get_auto_scaling_group_recommendations
method.
boto3 documentation
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)
...
- See FilterTypeDef
- See RecommendationPreferencesTypeDef
- See GetAutoScalingGroupRecommendationsResponseTypeDef
kwargs: GetAutoScalingGroupRecommendationsRequestRequestTypeDef = { # (1)
"accountIds": ...,
}
parent.get_auto_scaling_group_recommendations(**kwargs)
get_ebs_volume_recommendations
Returns Amazon Elastic Block Store (Amazon EBS) volume recommendations.
Type annotations and code completion for boto3.client("compute-optimizer").get_ebs_volume_recommendations
method.
boto3 documentation
def get_ebs_volume_recommendations(
self,
*,
volumeArns: Sequence[str] = ...,
nextToken: str = ...,
maxResults: int = ...,
filters: Sequence[EBSFilterTypeDef] = ..., # (1)
accountIds: Sequence[str] = ...,
) -> GetEBSVolumeRecommendationsResponseTypeDef: # (2)
...
kwargs: GetEBSVolumeRecommendationsRequestRequestTypeDef = { # (1)
"volumeArns": ...,
}
parent.get_ebs_volume_recommendations(**kwargs)
get_ec2_instance_recommendations
Returns Amazon EC2 instance recommendations.
Type annotations and code completion for boto3.client("compute-optimizer").get_ec2_instance_recommendations
method.
boto3 documentation
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)
...
- See FilterTypeDef
- See RecommendationPreferencesTypeDef
- See GetEC2InstanceRecommendationsResponseTypeDef
kwargs: GetEC2InstanceRecommendationsRequestRequestTypeDef = { # (1)
"instanceArns": ...,
}
parent.get_ec2_instance_recommendations(**kwargs)
get_ec2_recommendation_projected_metrics
Returns the projected utilization metrics of Amazon EC2 instance recommendations.
Type annotations and code completion for boto3.client("compute-optimizer").get_ec2_recommendation_projected_metrics
method.
boto3 documentation
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)
...
- See MetricStatisticType
- See RecommendationPreferencesTypeDef
- See GetEC2RecommendationProjectedMetricsResponseTypeDef
kwargs: GetEC2RecommendationProjectedMetricsRequestRequestTypeDef = { # (1)
"instanceArn": ...,
"stat": ...,
"period": ...,
"startTime": ...,
"endTime": ...,
}
parent.get_ec2_recommendation_projected_metrics(**kwargs)
get_ecs_service_recommendation_projected_metrics
Returns the projected metrics of Amazon ECS service recommendations.
Type annotations and code completion for boto3.client("compute-optimizer").get_ecs_service_recommendation_projected_metrics
method.
boto3 documentation
def get_ecs_service_recommendation_projected_metrics(
self,
*,
serviceArn: str,
stat: MetricStatisticType, # (1)
period: int,
startTime: Union[datetime, str],
endTime: Union[datetime, str],
) -> GetECSServiceRecommendationProjectedMetricsResponseTypeDef: # (2)
...
kwargs: GetECSServiceRecommendationProjectedMetricsRequestRequestTypeDef = { # (1)
"serviceArn": ...,
"stat": ...,
"period": ...,
"startTime": ...,
"endTime": ...,
}
parent.get_ecs_service_recommendation_projected_metrics(**kwargs)
get_ecs_service_recommendations
Returns Amazon ECS service recommendations.
Type annotations and code completion for boto3.client("compute-optimizer").get_ecs_service_recommendations
method.
boto3 documentation
def get_ecs_service_recommendations(
self,
*,
serviceArns: Sequence[str] = ...,
nextToken: str = ...,
maxResults: int = ...,
filters: Sequence[ECSServiceRecommendationFilterTypeDef] = ..., # (1)
accountIds: Sequence[str] = ...,
) -> GetECSServiceRecommendationsResponseTypeDef: # (2)
...
kwargs: GetECSServiceRecommendationsRequestRequestTypeDef = { # (1)
"serviceArns": ...,
}
parent.get_ecs_service_recommendations(**kwargs)
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 boto3.client("compute-optimizer").get_effective_recommendation_preferences
method.
boto3 documentation
def get_effective_recommendation_preferences(
self,
*,
resourceArn: str,
) -> GetEffectiveRecommendationPreferencesResponseTypeDef: # (1)
...
kwargs: GetEffectiveRecommendationPreferencesRequestRequestTypeDef = { # (1)
"resourceArn": ...,
}
parent.get_effective_recommendation_preferences(**kwargs)
get_enrollment_status
Returns the enrollment (opt in) status of an account to the Compute Optimizer service.
Type annotations and code completion for boto3.client("compute-optimizer").get_enrollment_status
method.
boto3 documentation
def get_enrollment_status(
self,
) -> GetEnrollmentStatusResponseTypeDef: # (1)
...
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 boto3.client("compute-optimizer").get_enrollment_statuses_for_organization
method.
boto3 documentation
def get_enrollment_statuses_for_organization(
self,
*,
filters: Sequence[EnrollmentFilterTypeDef] = ..., # (1)
nextToken: str = ...,
maxResults: int = ...,
) -> GetEnrollmentStatusesForOrganizationResponseTypeDef: # (2)
...
kwargs: GetEnrollmentStatusesForOrganizationRequestRequestTypeDef = { # (1)
"filters": ...,
}
parent.get_enrollment_statuses_for_organization(**kwargs)
get_lambda_function_recommendations
Returns Lambda function recommendations.
Type annotations and code completion for boto3.client("compute-optimizer").get_lambda_function_recommendations
method.
boto3 documentation
def get_lambda_function_recommendations(
self,
*,
functionArns: Sequence[str] = ...,
accountIds: Sequence[str] = ...,
filters: Sequence[LambdaFunctionRecommendationFilterTypeDef] = ..., # (1)
nextToken: str = ...,
maxResults: int = ...,
) -> GetLambdaFunctionRecommendationsResponseTypeDef: # (2)
...
kwargs: GetLambdaFunctionRecommendationsRequestRequestTypeDef = { # (1)
"functionArns": ...,
}
parent.get_lambda_function_recommendations(**kwargs)
get_recommendation_preferences
Returns existing recommendation preferences, such as enhanced infrastructure metrics.
Type annotations and code completion for boto3.client("compute-optimizer").get_recommendation_preferences
method.
boto3 documentation
def get_recommendation_preferences(
self,
*,
resourceType: ResourceTypeType, # (1)
scope: ScopeTypeDef = ..., # (2)
nextToken: str = ...,
maxResults: int = ...,
) -> GetRecommendationPreferencesResponseTypeDef: # (3)
...
kwargs: GetRecommendationPreferencesRequestRequestTypeDef = { # (1)
"resourceType": ...,
}
parent.get_recommendation_preferences(**kwargs)
get_recommendation_summaries
Returns the optimization findings for an account.
Type annotations and code completion for boto3.client("compute-optimizer").get_recommendation_summaries
method.
boto3 documentation
def get_recommendation_summaries(
self,
*,
accountIds: Sequence[str] = ...,
nextToken: str = ...,
maxResults: int = ...,
) -> GetRecommendationSummariesResponseTypeDef: # (1)
...
kwargs: GetRecommendationSummariesRequestRequestTypeDef = { # (1)
"accountIds": ...,
}
parent.get_recommendation_summaries(**kwargs)
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 boto3.client("compute-optimizer").put_recommendation_preferences
method.
boto3 documentation
def put_recommendation_preferences(
self,
*,
resourceType: ResourceTypeType, # (1)
scope: ScopeTypeDef = ..., # (2)
enhancedInfrastructureMetrics: EnhancedInfrastructureMetricsType = ..., # (3)
inferredWorkloadTypes: InferredWorkloadTypesPreferenceType = ..., # (4)
externalMetricsPreference: ExternalMetricsPreferenceTypeDef = ..., # (5)
) -> Dict[str, Any]:
...
- See ResourceTypeType
- See ScopeTypeDef
- See EnhancedInfrastructureMetricsType
- See InferredWorkloadTypesPreferenceType
- See ExternalMetricsPreferenceTypeDef
kwargs: PutRecommendationPreferencesRequestRequestTypeDef = { # (1)
"resourceType": ...,
}
parent.put_recommendation_preferences(**kwargs)
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 boto3.client("compute-optimizer").update_enrollment_status
method.
boto3 documentation
def update_enrollment_status(
self,
*,
status: StatusType, # (1)
includeMemberAccounts: bool = ...,
) -> UpdateEnrollmentStatusResponseTypeDef: # (2)
...
kwargs: UpdateEnrollmentStatusRequestRequestTypeDef = { # (1)
"status": ...,
}
parent.update_enrollment_status(**kwargs)
get_paginator
Type annotations and code completion for boto3.client("compute-optimizer").get_paginator
method with overloads.
client.get_paginator("describe_recommendation_export_jobs")
-> DescribeRecommendationExportJobsPaginatorclient.get_paginator("get_enrollment_statuses_for_organization")
-> GetEnrollmentStatusesForOrganizationPaginatorclient.get_paginator("get_lambda_function_recommendations")
-> GetLambdaFunctionRecommendationsPaginatorclient.get_paginator("get_recommendation_preferences")
-> GetRecommendationPreferencesPaginatorclient.get_paginator("get_recommendation_summaries")
-> GetRecommendationSummariesPaginator