CostExplorer / Client / start_commitment_purchase_analysis

start_commitment_purchase_analysis#

CostExplorer.Client.start_commitment_purchase_analysis(**kwargs)#

Specifies the parameters of a planned commitment purchase and starts the generation of the analysis. This enables you to estimate the cost, coverage, and utilization impact of your planned commitment purchases. You can request up to 20 analysis runs per day.

See also: AWS API Documentation

Request Syntax

response = client.start_commitment_purchase_analysis(
    CommitmentPurchaseAnalysisConfiguration={
        'SavingsPlansPurchaseAnalysisConfiguration': {
            'AccountScope': 'PAYER'|'LINKED',
            'AccountId': 'string',
            'AnalysisType': 'MAX_SAVINGS'|'CUSTOM_COMMITMENT',
            'SavingsPlansToAdd': [
                {
                    'PaymentOption': 'NO_UPFRONT'|'PARTIAL_UPFRONT'|'ALL_UPFRONT'|'LIGHT_UTILIZATION'|'MEDIUM_UTILIZATION'|'HEAVY_UTILIZATION',
                    'SavingsPlansType': 'COMPUTE_SP'|'EC2_INSTANCE_SP'|'SAGEMAKER_SP',
                    'Region': 'string',
                    'InstanceFamily': 'string',
                    'TermInYears': 'ONE_YEAR'|'THREE_YEARS',
                    'SavingsPlansCommitment': 123.0,
                    'OfferingId': 'string'
                },
            ],
            'SavingsPlansToExclude': [
                'string',
            ],
            'LookBackTimePeriod': {
                'Start': 'string',
                'End': 'string'
            }
        }
    }
)
Parameters:

CommitmentPurchaseAnalysisConfiguration (dict) –

[REQUIRED]

The configuration for the commitment purchase analysis.

  • SavingsPlansPurchaseAnalysisConfiguration (dict) –

    The configuration for the Savings Plans purchase analysis.

    • AccountScope (string) –

      The account scope that you want your analysis for.

    • AccountId (string) –

      The account that the analysis is for.

    • AnalysisType (string) – [REQUIRED]

      The type of analysis.

    • SavingsPlansToAdd (list) – [REQUIRED]

      Savings Plans to include in the analysis.

      • (dict) –

        The Savings Plans commitment details.

        • PaymentOption (string) –

          The payment option for the Savings Plans commitment.

        • SavingsPlansType (string) –

          The Savings Plans type.

        • Region (string) –

          The Region associated with the Savings Plans commitment.

        • InstanceFamily (string) –

          The instance family of the Savings Plans commitment.

        • TermInYears (string) –

          The term that you want the Savings Plans commitment for.

        • SavingsPlansCommitment (float) –

          The Savings Plans commitment.

        • OfferingId (string) –

          The unique ID that’s used to distinguish commitments from one another.

    • SavingsPlansToExclude (list) –

      Savings Plans to exclude from the analysis.

      • (string) –

    • LookBackTimePeriod (dict) – [REQUIRED]

      The time period associated with the analysis.

      • Start (string) – [REQUIRED]

        The beginning of the time period. The start date is inclusive. For example, if start is 2017-01-01, Amazon Web Services retrieves cost and usage data starting at 2017-01-01 up to the end date. The start date must be equal to or no later than the current date to avoid a validation error.

      • End (string) – [REQUIRED]

        The end of the time period. The end date is exclusive. For example, if end is 2017-05-01, Amazon Web Services retrieves cost and usage data from the start date up to, but not including, 2017-05-01.

Return type:

dict

Returns:

Response Syntax

{
    'AnalysisId': 'string',
    'AnalysisStartedTime': 'string',
    'EstimatedCompletionTime': 'string'
}

Response Structure

  • (dict) –

    • AnalysisId (string) –

      The analysis ID that’s associated with the commitment purchase analysis.

    • AnalysisStartedTime (string) –

      The start time of the analysis.

    • EstimatedCompletionTime (string) –

      The estimated time for when the analysis will complete.

Exceptions

  • CostExplorer.Client.exceptions.LimitExceededException

  • CostExplorer.Client.exceptions.ServiceQuotaExceededException

  • CostExplorer.Client.exceptions.DataUnavailableException

  • CostExplorer.Client.exceptions.GenerationExistsException