sedai.optimizations
The configuration of a resource monitored by Sedai.
Configuration for a Kubernetes workload.
Container configuration of a Kubernetes resource monitored by Sedai.
Details of a single nodegroup for hosting a cluster.
The nodegroup configuration for hosting a cluster.
Configuration for S3 intelligent tiering.
Configuration for S3 lifecycle rules.
Configuration for an S3 bucket.
The intelligent tiering configurations for the bucket.
Configuration for an EBS volume.
Configuration for an ECS container.
Configuration for an ECS resource.
Configuration for a Kubernetes resource.
Configuration for a Serverless Lambda resource.
Details of all potential optimization opportunities for a cluster.
Summary of the estimated cost projection for this cluster.
Details of nodegroup optimizations recommended for this cluster.
Details of workload optimizations recommended for this cluster.
Details of potential resource optimization opportunities. This may also include opportunities for resources that are set to autonomous.
Retrieves recommendations from the Sedai API.
Returns: dict: A dictionary containing the recommendation data.
Returns details of available optimization opportunities for a cluster.
Parameters
- cluster_id: ID of the cluster to retrieve opportunities for.
- optimization_targets: Optimization targets to consider. Possible options are
NODE
,WORK_LOAD
andPURCHASE_OPTION
.
Returns
Details of potential optimization opportunities for the given cluster.
Optimizations for the nodegroup configuration of a cluster.
Recommendations for the original nodegroup configuration for this cluster.
Recommended optimal nodegroup configuration for this cluster.
Details of an optimization proposed for a resource.
Details of an optimization proposed for a Kubernetes resource.
The original container configuration of the Kubernetes resource.
Optimized container configuration recommended by Sedai.
The original workload configuration of the Kubernetes resource.
Get details of completed optimizations.
Parameters
- account_id: Optional account ID to query for optimizations recommended for the given account.
- resource_id: Optional resource ID to query for optimizations recommended for the given resource.
- starttime: Retrieve optimizations performed after the given starttime.
- endtime: Retrieve optimizations performed before the given endtime.
- sort_by: Attribute to sort the retrieved optimizations by. Possible options are
optimization_time
: The time at which the optimization was performed.cpu_change_core
: Change in CPU cores.cpu_change_vcpu
: Change in VCPUs.memory_change_mib
: Change in memory in MiBs.storage_change_gib
: Change in storage size in GiBs.
- sort_dir: Sort direction for retrieving optimizations. Possible options are
ASC
andDESC
.
Get the latest available recommended state for a given resource. This is the state that Sedai automatically syncs resources to if Sedai Sync is enabled for that resource.
Parameters
- resource_id: ID of the resource to retrieve the recommended state for.
Returns
The latest recommended resource state if available.
Base class for all operations.
Represents a Kubernetes node pool operation.
Represents an S3 bucket operation.
Represents an EBS volume type tuning operation.
Represents a VM storage right sizing operation.
Represents an ECS cluster operation.
Represents an ECS app operation.
Represents a Kubernetes app operation.
An operation on a serverless function.
An operation on a serverless function to scale memory.
Represents a scale down memory operation.
Represents a scale up memory operation.
An operation on a serverless function to scale timeout.
Represents an increase timeout operation.
Represents a decrease timeout operation.
An operation to increase the reserved concurrency of a Lambda function.
Represents a decrease reserved concurrency operation.
An operation to increase the provisioned concurrency of a Lambda function.
Represents a decrease provisioned concurrency operation.
Represents a recommendation generated in Sedai.
The type of recommendation. This could be
AVAILABILITY
: A recommendation to resolve availability issues.EFFICIENCY
: A recommendation to optimize the resource for cost or performance.
The status of the recommendation. This could be one of the following:
EXECUTING
: The recommendation is currently being executed.PROPOSED
: The recommendation is proposed.EXPIRED
: The recommendation has expired.FAILED
: The recommendation execution has failed.USER_REJECTED
: The user has rejected the recommendation.UNSAFE_TO_ACT
: The recommendation is unsafe to act on.SUCCESSFUL
: The recommendation execution has been successful.PAUSED
: The recommendation execution has been paused.
Details of the operation associated with this recommendation. This field is only populated if the
include_operation_details
parameter is set to True
in the get_recommendations
function.
Returns a sedai.pagination.PageIterator
of all recommendations available in Sedai.
Parameters
- account_ids: Optional list of Sedai account IDs for which recommendations are to be fetched. If None, recommendations for all accounts are fetched.
- resource_id: The Sedai ID of the resource for which recommendations are to be fetched. If None, recommendations for all resources are fetched.
- starttime: Optional start time for the recommendations to be fetched.
- endtime: Optional end time for the recommendations to be fetched. If None, the current time is considered as the end time.
recommendation_status: Optional list of recommendation statuses to filter the recommendations by. Possible values are
EXECUTING
: The recommendation is currently being executed.PROPOSED
: The recommendation is proposed.EXPIRED
: The recommendation has expired.FAILED
: The recommendation execution has failed.USER_REJECTED
: The user has rejected the recommendation.UNSAFE_TO_ACT
: The recommendation is unsafe to act on.SUCCESSFUL
: The recommendation execution has been successful.PAUSED
: The recommendation execution has been paused.
If no status is provided, all recommendations are fetched.
recommendation_types: Optional list of recommendation types to filter the recommendations by. Possible values are
AVAILABILITY
: A recommendation to resolve availability issues.EFFICIENCY
: A recommendation to optimize the resource for cost or performance.
If no recommendation type is provided, all recommendation types are fetched.
- pagination_config: The pagination configuration for fetching recommendations. Refer to
sedai.pagination.PaginationConfig
for more details about the available options. If None, the first page of recommendations is fetched, and the function returns a list of recommendations as dictionaries instead of asedai.pagination.PageIterator
object. For default pagination configuration, usesedai.pagination.DEFAULT_PAGINATION_CONFIG
. - include_operation_details: Optional boolean flag to indicate whether to include details of the operation associated with the
recommendation. If set to
True
, the operation details are included in theoperation
field of theRecommendation
object. Default isFalse
. - action_name: Optional name of the action for which recommendations are to be fetched. If None, recommendations for all actions are fetched.
Returns
A
sedai.pagination.PageIterator
ofRecommendation
objects representing the recommendations.