BillingandCostManagementPricingCalculator / Client / batch_create_bill_scenario_commitment_modification

batch_create_bill_scenario_commitment_modification#

BillingandCostManagementPricingCalculator.Client.batch_create_bill_scenario_commitment_modification(**kwargs)#

Create Compute Savings Plans, EC2 Instance Savings Plans, or EC2 Reserved Instances commitments that you want to model in a Bill Scenario.

See also: AWS API Documentation

Request Syntax

response = client.batch_create_bill_scenario_commitment_modification(
    billScenarioId='string',
    commitmentModifications=[
        {
            'key': 'string',
            'group': 'string',
            'usageAccountId': 'string',
            'commitmentAction': {
                'addReservedInstanceAction': {
                    'reservedInstancesOfferingId': 'string',
                    'instanceCount': 123
                },
                'addSavingsPlanAction': {
                    'savingsPlanOfferingId': 'string',
                    'commitment': 123.0
                },
                'negateReservedInstanceAction': {
                    'reservedInstancesId': 'string'
                },
                'negateSavingsPlanAction': {
                    'savingsPlanId': 'string'
                }
            }
        },
    ],
    clientToken='string'
)
Parameters:
  • billScenarioId (string) –

    [REQUIRED]

    The ID of the Bill Scenario for which you want to create the modeled commitment.

  • commitmentModifications (list) –

    [REQUIRED]

    List of commitments that you want to model in the Bill Scenario.

    • (dict) –

      Represents an entry object in the batch operation to create bill scenario commitment modifications.

      • key (string) – [REQUIRED]

        A unique identifier for this entry in the batch operation. This can be any valid string. This key is useful to identify errors associated with any commitment entry as any error is returned with this key.

      • group (string) –

        An optional group identifier for the commitment modification.

      • usageAccountId (string) – [REQUIRED]

        The Amazon Web Services account ID to which this commitment will be applied to.

      • commitmentAction (dict) – [REQUIRED]

        The specific commitment action to be taken (e.g., adding a Reserved Instance or Savings Plan).

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: addReservedInstanceAction, addSavingsPlanAction, negateReservedInstanceAction, negateSavingsPlanAction.

        • addReservedInstanceAction (dict) –

          Action to add a Reserved Instance to the scenario.

          • reservedInstancesOfferingId (string) –

            The ID of the Reserved Instance offering to add. For more information, see DescribeReservedInstancesOfferings.

          • instanceCount (integer) –

            The number of instances to add for this Reserved Instance offering.

        • addSavingsPlanAction (dict) –

          Action to add a Savings Plan to the scenario.

          • savingsPlanOfferingId (string) –

            The ID of the Savings Plan offering to add. For more information, see DescribeSavingsPlansOfferings.

          • commitment (float) –

            The hourly commitment, in the same currency of the savingsPlanOfferingId. This is a value between 0.001 and 1 million. You cannot specify more than five digits after the decimal point.

        • negateReservedInstanceAction (dict) –

          Action to remove a Reserved Instance from the scenario.

          • reservedInstancesId (string) –

            The ID of the Reserved Instance to remove.

        • negateSavingsPlanAction (dict) –

          Action to remove a Savings Plan from the scenario.

          • savingsPlanId (string) –

            The ID of the Savings Plan to remove.

  • clientToken (string) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'items': [
        {
            'key': 'string',
            'id': 'string',
            'group': 'string',
            'usageAccountId': 'string',
            'commitmentAction': {
                'addReservedInstanceAction': {
                    'reservedInstancesOfferingId': 'string',
                    'instanceCount': 123
                },
                'addSavingsPlanAction': {
                    'savingsPlanOfferingId': 'string',
                    'commitment': 123.0
                },
                'negateReservedInstanceAction': {
                    'reservedInstancesId': 'string'
                },
                'negateSavingsPlanAction': {
                    'savingsPlanId': 'string'
                }
            }
        },
    ],
    'errors': [
        {
            'key': 'string',
            'errorMessage': 'string',
            'errorCode': 'CONFLICT'|'INTERNAL_SERVER_ERROR'|'INVALID_ACCOUNT'
        },
    ]
}

Response Structure

  • (dict) –

    • items (list) –

      Returns the list of successful commitment line items that were created for the Bill Scenario.

      • (dict) –

        Represents a successfully created item in a batch operation for bill scenario commitment modifications.

        • key (string) –

          The key of the successfully created entry. This can be any valid string. This key is useful to identify errors associated with any commitment entry as any error is returned with this key.

        • id (string) –

          The unique identifier assigned to the created commitment modification.

        • group (string) –

          The group identifier for the created commitment modification.

        • usageAccountId (string) –

          The Amazon Web Services account ID associated with the created commitment modification.

        • commitmentAction (dict) –

          The specific commitment action that was taken.

          Note

          This is a Tagged Union structure. Only one of the following top level keys will be set: addReservedInstanceAction, addSavingsPlanAction, negateReservedInstanceAction, negateSavingsPlanAction. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

          'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
          
          • addReservedInstanceAction (dict) –

            Action to add a Reserved Instance to the scenario.

            • reservedInstancesOfferingId (string) –

              The ID of the Reserved Instance offering to add. For more information, see DescribeReservedInstancesOfferings.

            • instanceCount (integer) –

              The number of instances to add for this Reserved Instance offering.

          • addSavingsPlanAction (dict) –

            Action to add a Savings Plan to the scenario.

            • savingsPlanOfferingId (string) –

              The ID of the Savings Plan offering to add. For more information, see DescribeSavingsPlansOfferings.

            • commitment (float) –

              The hourly commitment, in the same currency of the savingsPlanOfferingId. This is a value between 0.001 and 1 million. You cannot specify more than five digits after the decimal point.

          • negateReservedInstanceAction (dict) –

            Action to remove a Reserved Instance from the scenario.

            • reservedInstancesId (string) –

              The ID of the Reserved Instance to remove.

          • negateSavingsPlanAction (dict) –

            Action to remove a Savings Plan from the scenario.

            • savingsPlanId (string) –

              The ID of the Savings Plan to remove.

    • errors (list) –

      Returns the list of errors reason and the commitment item keys that cannot be created in the Bill Scenario.

      • (dict) –

        Represents an error that occurred during a batch create operation for bill scenario commitment modifications.

        • key (string) –

          The key of the entry that caused the error.

        • errorMessage (string) –

          A descriptive message for the error that occurred.

        • errorCode (string) –

          The error code associated with the failed operation.

Exceptions

  • BillingandCostManagementPricingCalculator.Client.exceptions.ConflictException

  • BillingandCostManagementPricingCalculator.Client.exceptions.ValidationException

  • BillingandCostManagementPricingCalculator.Client.exceptions.DataUnavailableException

  • BillingandCostManagementPricingCalculator.Client.exceptions.InternalServerException

  • BillingandCostManagementPricingCalculator.Client.exceptions.ResourceNotFoundException

  • BillingandCostManagementPricingCalculator.Client.exceptions.AccessDeniedException

  • BillingandCostManagementPricingCalculator.Client.exceptions.ThrottlingException