BillingandCostManagementPricingCalculator / Client / batch_create_bill_scenario_usage_modification

batch_create_bill_scenario_usage_modification#

BillingandCostManagementPricingCalculator.Client.batch_create_bill_scenario_usage_modification(**kwargs)#

Create Amazon Web Services service usage that you want to model in a Bill Scenario.

See also: AWS API Documentation

Request Syntax

response = client.batch_create_bill_scenario_usage_modification(
    billScenarioId='string',
    usageModifications=[
        {
            'serviceCode': 'string',
            'usageType': 'string',
            'operation': 'string',
            'availabilityZone': 'string',
            'key': 'string',
            'group': 'string',
            'usageAccountId': 'string',
            'amounts': [
                {
                    'startHour': datetime(2015, 1, 1),
                    'amount': 123.0
                },
            ],
            'historicalUsage': {
                'serviceCode': 'string',
                'usageType': 'string',
                'operation': 'string',
                'location': 'string',
                'usageAccountId': 'string',
                'billInterval': {
                    'start': datetime(2015, 1, 1),
                    'end': datetime(2015, 1, 1)
                },
                'filterExpression': {
                    'and': [
                        {'... recursive ...'},
                    ],
                    'or': [
                        {'... recursive ...'},
                    ],
                    'not': {'... recursive ...'},
                    'costCategories': {
                        'key': 'string',
                        'matchOptions': [
                            'string',
                        ],
                        'values': [
                            'string',
                        ]
                    },
                    'dimensions': {
                        'key': 'string',
                        'matchOptions': [
                            'string',
                        ],
                        'values': [
                            'string',
                        ]
                    },
                    'tags': {
                        'key': 'string',
                        'matchOptions': [
                            'string',
                        ],
                        'values': [
                            'string',
                        ]
                    }
                }
            }
        },
    ],
    clientToken='string'
)
Parameters:
  • billScenarioId (string) –

    [REQUIRED]

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

  • usageModifications (list) –

    [REQUIRED]

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

    • (dict) –

      Represents an entry in a batch operation to create bill scenario usage modifications.

      • serviceCode (string) – [REQUIRED]

        The Amazon Web Services service code for this usage modification. This identifies the specific Amazon Web Services service to the customer as a unique short abbreviation. For example, AmazonEC2 and AWSKMS.

      • usageType (string) – [REQUIRED]

        Describes the usage details of the usage line item.

      • operation (string) – [REQUIRED]

        The specific operation associated with this usage modification. Describes the specific Amazon Web Services operation that this usage line models. For example, RunInstances indicates the operation of an Amazon EC2 instance.

      • availabilityZone (string) –

        The Availability Zone that this usage line uses.

      • 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 usage entry as any error is returned with this key.

      • group (string) –

        An optional group identifier for the usage modification.

      • usageAccountId (string) – [REQUIRED]

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

      • amounts (list) –

        The amount of usage you want to create for the service use you are modeling.

        • (dict) –

          Represents a usage amount for a specific time period.

          • startHour (datetime) – [REQUIRED]

            The start hour of the usage period.

          • amount (float) – [REQUIRED]

            The usage amount for the period.

      • historicalUsage (dict) –

        Historical usage data associated with this modification, if available.

        • serviceCode (string) – [REQUIRED]

          The Amazon Web Services service code associated with the usage.

        • usageType (string) – [REQUIRED]

          The type of usage.

        • operation (string) – [REQUIRED]

          The specific operation associated with the usage.

        • location (string) –

          The location associated with the usage.

        • usageAccountId (string) – [REQUIRED]

          The Amazon Web Services account ID associated with the usage.

        • billInterval (dict) – [REQUIRED]

          The time interval for the historical usage data.

          • start (datetime) –

            The start date and time of the interval.

          • end (datetime) –

            The end date and time of the interval.

        • filterExpression (dict) – [REQUIRED]

          An optional filter expression to apply to the historical usage data.

          • and (list) –

            A list of expressions to be combined with AND logic.

            • (dict) –

              Represents a complex filtering expression for cost and usage data.

          • or (list) –

            A list of expressions to be combined with OR logic.

            • (dict) –

              Represents a complex filtering expression for cost and usage data.

          • not (dict) –

            An expression to be negated.

          • costCategories (dict) –

            Filters based on cost categories.

            • key (string) –

              The key or attribute to filter on.

            • matchOptions (list) –

              The match options for the filter (e.g., equals, contains).

              • (string) –

            • values (list) –

              The values to match against.

              • (string) –

          • dimensions (dict) –

            Filters based on dimensions (e.g., service, operation).

            • key (string) –

              The key or attribute to filter on.

            • matchOptions (list) –

              The match options for the filter (e.g., equals, contains).

              • (string) –

            • values (list) –

              The values to match against.

              • (string) –

          • tags (dict) –

            Filters based on resource tags.

            • key (string) –

              The key or attribute to filter on.

            • matchOptions (list) –

              The match options for the filter (e.g., equals, contains).

              • (string) –

            • values (list) –

              The values to match against.

              • (string) –

  • 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': [
        {
            'serviceCode': 'string',
            'usageType': 'string',
            'operation': 'string',
            'location': 'string',
            'availabilityZone': 'string',
            'id': 'string',
            'group': 'string',
            'usageAccountId': 'string',
            'quantities': [
                {
                    'startHour': datetime(2015, 1, 1),
                    'unit': 'string',
                    'amount': 123.0
                },
            ],
            'historicalUsage': {
                'serviceCode': 'string',
                'usageType': 'string',
                'operation': 'string',
                'location': 'string',
                'usageAccountId': 'string',
                'billInterval': {
                    'start': datetime(2015, 1, 1),
                    'end': datetime(2015, 1, 1)
                },
                'filterExpression': {
                    'and': [
                        {'... recursive ...'},
                    ],
                    'or': [
                        {'... recursive ...'},
                    ],
                    'not': {'... recursive ...'},
                    'costCategories': {
                        'key': 'string',
                        'matchOptions': [
                            'string',
                        ],
                        'values': [
                            'string',
                        ]
                    },
                    'dimensions': {
                        'key': 'string',
                        'matchOptions': [
                            'string',
                        ],
                        'values': [
                            'string',
                        ]
                    },
                    'tags': {
                        'key': 'string',
                        'matchOptions': [
                            'string',
                        ],
                        'values': [
                            'string',
                        ]
                    }
                }
            },
            'key': 'string'
        },
    ],
    'errors': [
        {
            'key': 'string',
            'errorMessage': 'string',
            'errorCode': 'BAD_REQUEST'|'NOT_FOUND'|'CONFLICT'|'INTERNAL_SERVER_ERROR'
        },
    ]
}

Response Structure

  • (dict) –

    • items (list) –

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

      • (dict) –

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

        • serviceCode (string) –

          The Amazon Web Services service code for this usage modification.

        • usageType (string) –

          The type of usage that was modified.

        • operation (string) –

          The specific operation associated with this usage modification.

        • location (string) –

          The location associated with this usage modification.

        • availabilityZone (string) –

          The availability zone associated with this usage modification, if applicable.

        • id (string) –

          The unique identifier assigned to the created usage modification.

        • group (string) –

          The group identifier for the created usage modification.

        • usageAccountId (string) –

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

        • quantities (list) –

          The modified usage quantities.

          • (dict) –

            Represents a usage quantity with associated unit and time period.

            • startHour (datetime) –

              The start hour of the usage period.

            • unit (string) –

              The unit of measurement for the usage quantity.

            • amount (float) –

              The numeric value of the usage quantity.

        • historicalUsage (dict) –

          Historical usage data associated with this modification, if available.

          • serviceCode (string) –

            The Amazon Web Services service code associated with the usage.

          • usageType (string) –

            The type of usage.

          • operation (string) –

            The specific operation associated with the usage.

          • location (string) –

            The location associated with the usage.

          • usageAccountId (string) –

            The Amazon Web Services account ID associated with the usage.

          • billInterval (dict) –

            The time interval for the historical usage data.

            • start (datetime) –

              The start date and time of the interval.

            • end (datetime) –

              The end date and time of the interval.

          • filterExpression (dict) –

            An optional filter expression to apply to the historical usage data.

            • and (list) –

              A list of expressions to be combined with AND logic.

              • (dict) –

                Represents a complex filtering expression for cost and usage data.

            • or (list) –

              A list of expressions to be combined with OR logic.

              • (dict) –

                Represents a complex filtering expression for cost and usage data.

            • not (dict) –

              An expression to be negated.

            • costCategories (dict) –

              Filters based on cost categories.

              • key (string) –

                The key or attribute to filter on.

              • matchOptions (list) –

                The match options for the filter (e.g., equals, contains).

                • (string) –

              • values (list) –

                The values to match against.

                • (string) –

            • dimensions (dict) –

              Filters based on dimensions (e.g., service, operation).

              • key (string) –

                The key or attribute to filter on.

              • matchOptions (list) –

                The match options for the filter (e.g., equals, contains).

                • (string) –

              • values (list) –

                The values to match against.

                • (string) –

            • tags (dict) –

              Filters based on resource tags.

              • key (string) –

                The key or attribute to filter on.

              • matchOptions (list) –

                The match options for the filter (e.g., equals, contains).

                • (string) –

              • values (list) –

                The values to match against.

                • (string) –

        • key (string) –

          The key of the successfully created entry.

    • errors (list) –

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

      • (dict) –

        Represents an error that occurred during a batch create operation for bill scenario usage 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.ServiceQuotaExceededException

  • BillingandCostManagementPricingCalculator.Client.exceptions.InternalServerException

  • BillingandCostManagementPricingCalculator.Client.exceptions.ResourceNotFoundException

  • BillingandCostManagementPricingCalculator.Client.exceptions.AccessDeniedException

  • BillingandCostManagementPricingCalculator.Client.exceptions.ThrottlingException