AWSBillingConductor

2022/11/08 - AWSBillingConductor - 1 new 3 updated api methods

Changes  This release adds the Recurring Custom Line Item feature along with a new API ListCustomLineItemVersions.

ListCustomLineItemVersions (new) Link ¶

A paginated call to get a list of all custom line item versions.

See also: AWS API Documentation

Request Syntax

client.list_custom_line_item_versions(
    Arn='string',
    MaxResults=123,
    NextToken='string',
    Filters={
        'BillingPeriodRange': {
            'StartBillingPeriod': 'string',
            'EndBillingPeriod': 'string'
        }
    }
)
type Arn

string

param Arn

[REQUIRED]

The Amazon Resource Name (ARN) for the custom line item.

type MaxResults

integer

param MaxResults

The maximum number of custom line item versions to retrieve.

type NextToken

string

param NextToken

The pagination token that's used on subsequent calls to retrieve custom line item versions.

type Filters

dict

param Filters

A ListCustomLineItemVersionsFilter that specifies the billing period range in which the custom line item versions are applied.

  • BillingPeriodRange (dict) --

    The billing period range in which the custom line item version is applied.

    • StartBillingPeriod (string) --

      The inclusive start billing period that defines a billing period range where a custom line item version is applied.

    • EndBillingPeriod (string) --

      The exclusive end billing period that defines a billing period range where a custom line item version is applied.

rtype

dict

returns

Response Syntax

{
    'CustomLineItemVersions': [
        {
            'Name': 'string',
            'ChargeDetails': {
                'Flat': {
                    'ChargeValue': 123.0
                },
                'Percentage': {
                    'PercentageValue': 123.0
                },
                'Type': 'CREDIT'|'FEE'
            },
            'CurrencyCode': 'USD'|'CNY',
            'Description': 'string',
            'ProductCode': 'string',
            'BillingGroupArn': 'string',
            'CreationTime': 123,
            'LastModifiedTime': 123,
            'AssociationSize': 123,
            'StartBillingPeriod': 'string',
            'EndBillingPeriod': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • CustomLineItemVersions (list) --

      A list of CustomLineItemVersionListElements that are received.

      • (dict) --

        A representation of a custom line item version.

        • Name (string) --

          The name of the custom line item.

        • ChargeDetails (dict) --

          A representation of the charge details of a custom line item.

          • Flat (dict) --

            A ListCustomLineItemFlatChargeDetails that describes the charge details of a flat custom line item.

            • ChargeValue (float) --

              The custom line item's fixed charge value in USD.

          • Percentage (dict) --

            A ListCustomLineItemPercentageChargeDetails that describes the charge details of a percentage custom line item.

            • PercentageValue (float) --

              The custom line item's percentage value. This will be multiplied against the combined value of its associated resources to determine its charge value.

          • Type (string) --

            The type of the custom line item that indicates whether the charge is a fee or credit .

        • CurrencyCode (string) --

          The charge value currency of the custom line item.

        • Description (string) --

          The description of the custom line item.

        • ProductCode (string) --

          The product code that’s associated with the custom line item.

        • BillingGroupArn (string) --

          The Amazon Resource Name (ARN) of the billing group that the custom line item applies to.

        • CreationTime (integer) --

          The time when the custom line item version was created.

        • LastModifiedTime (integer) --

          The most recent time that the custom line item version was modified.

        • AssociationSize (integer) --

          The number of resources that are associated with the custom line item.

        • StartBillingPeriod (string) --

          The start billing period of the custom line item version.

        • EndBillingPeriod (string) --

          The end billing period of the custom line item version.

    • NextToken (string) --

      The pagination token that's used on subsequent calls to retrieve custom line item versions.

BatchAssociateResourcesToCustomLineItem (updated) Link ¶
Changes (response)
{'FailedAssociatedResources': {'Error': {'Reason': {'INVALID_BILLING_PERIOD_RANGE'}}},
 'SuccessfullyAssociatedResources': {'Error': {'Reason': {'INVALID_BILLING_PERIOD_RANGE'}}}}

Associates a batch of resources to a percentage custom line item.

See also: AWS API Documentation

Request Syntax

client.batch_associate_resources_to_custom_line_item(
    TargetArn='string',
    ResourceArns=[
        'string',
    ],
    BillingPeriodRange={
        'InclusiveStartBillingPeriod': 'string',
        'ExclusiveEndBillingPeriod': 'string'
    }
)
type TargetArn

string

param TargetArn

[REQUIRED]

A percentage custom line item ARN to associate the resources to.

type ResourceArns

list

param ResourceArns

[REQUIRED]

A list containing the ARNs of the resources to be associated.

  • (string) --

type BillingPeriodRange

dict

param BillingPeriodRange

The billing period range in which the custom line item request will be applied.

  • InclusiveStartBillingPeriod (string) -- [REQUIRED]

    The inclusive start billing period that defines a billing period range where a custom line is applied.

  • ExclusiveEndBillingPeriod (string) --

    The inclusive end billing period that defines a billing period range where a custom line is applied.

rtype

dict

returns

Response Syntax

{
    'SuccessfullyAssociatedResources': [
        {
            'Arn': 'string',
            'Error': {
                'Message': 'string',
                'Reason': 'INVALID_ARN'|'SERVICE_LIMIT_EXCEEDED'|'ILLEGAL_CUSTOMLINEITEM'|'INTERNAL_SERVER_EXCEPTION'|'INVALID_BILLING_PERIOD_RANGE'
            }
        },
    ],
    'FailedAssociatedResources': [
        {
            'Arn': 'string',
            'Error': {
                'Message': 'string',
                'Reason': 'INVALID_ARN'|'SERVICE_LIMIT_EXCEEDED'|'ILLEGAL_CUSTOMLINEITEM'|'INTERNAL_SERVER_EXCEPTION'|'INVALID_BILLING_PERIOD_RANGE'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • SuccessfullyAssociatedResources (list) --

      A list of AssociateResourceResponseElement for each resource that's been associated to a percentage custom line item successfully.

      • (dict) --

        A resource association result for a percentage custom line item.

        • Arn (string) --

          The resource ARN that was associated to the custom line item.

        • Error (dict) --

          An AssociateResourceError that will populate if the resource association fails.

          • Message (string) --

            The reason why the resource association failed.

          • Reason (string) --

            A static error code that's used to classify the type of failure.

    • FailedAssociatedResources (list) --

      A list of AssociateResourceResponseElement for each resource that failed association to a percentage custom line item.

      • (dict) --

        A resource association result for a percentage custom line item.

        • Arn (string) --

          The resource ARN that was associated to the custom line item.

        • Error (dict) --

          An AssociateResourceError that will populate if the resource association fails.

          • Message (string) --

            The reason why the resource association failed.

          • Reason (string) --

            A static error code that's used to classify the type of failure.

BatchDisassociateResourcesFromCustomLineItem (updated) Link ¶
Changes (response)
{'FailedDisassociatedResources': {'Error': {'Reason': {'INVALID_BILLING_PERIOD_RANGE'}}},
 'SuccessfullyDisassociatedResources': {'Error': {'Reason': {'INVALID_BILLING_PERIOD_RANGE'}}}}

Disassociates a batch of resources from a percentage custom line item.

See also: AWS API Documentation

Request Syntax

client.batch_disassociate_resources_from_custom_line_item(
    TargetArn='string',
    ResourceArns=[
        'string',
    ],
    BillingPeriodRange={
        'InclusiveStartBillingPeriod': 'string',
        'ExclusiveEndBillingPeriod': 'string'
    }
)
type TargetArn

string

param TargetArn

[REQUIRED]

A percentage custom line item ARN to disassociate the resources from.

type ResourceArns

list

param ResourceArns

[REQUIRED]

A list containing the ARNs of resources to be disassociated.

  • (string) --

type BillingPeriodRange

dict

param BillingPeriodRange

The billing period range in which the custom line item request will be applied.

  • InclusiveStartBillingPeriod (string) -- [REQUIRED]

    The inclusive start billing period that defines a billing period range where a custom line is applied.

  • ExclusiveEndBillingPeriod (string) --

    The inclusive end billing period that defines a billing period range where a custom line is applied.

rtype

dict

returns

Response Syntax

{
    'SuccessfullyDisassociatedResources': [
        {
            'Arn': 'string',
            'Error': {
                'Message': 'string',
                'Reason': 'INVALID_ARN'|'SERVICE_LIMIT_EXCEEDED'|'ILLEGAL_CUSTOMLINEITEM'|'INTERNAL_SERVER_EXCEPTION'|'INVALID_BILLING_PERIOD_RANGE'
            }
        },
    ],
    'FailedDisassociatedResources': [
        {
            'Arn': 'string',
            'Error': {
                'Message': 'string',
                'Reason': 'INVALID_ARN'|'SERVICE_LIMIT_EXCEEDED'|'ILLEGAL_CUSTOMLINEITEM'|'INTERNAL_SERVER_EXCEPTION'|'INVALID_BILLING_PERIOD_RANGE'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • SuccessfullyDisassociatedResources (list) --

      A list of DisassociateResourceResponseElement for each resource that's been disassociated from a percentage custom line item successfully.

      • (dict) --

        A resource disassociation result for a percentage custom line item.

        • Arn (string) --

          The resource ARN that was disassociated from the custom line item.

        • Error (dict) --

          An AssociateResourceError that's shown if the resource disassociation fails.

          • Message (string) --

            The reason why the resource association failed.

          • Reason (string) --

            A static error code that's used to classify the type of failure.

    • FailedDisassociatedResources (list) --

      A list of DisassociateResourceResponseElement for each resource that failed disassociation from a percentage custom line item.

      • (dict) --

        A resource disassociation result for a percentage custom line item.

        • Arn (string) --

          The resource ARN that was disassociated from the custom line item.

        • Error (dict) --

          An AssociateResourceError that's shown if the resource disassociation fails.

          • Message (string) --

            The reason why the resource association failed.

          • Reason (string) --

            A static error code that's used to classify the type of failure.

ListResourcesAssociatedToCustomLineItem (updated) Link ¶
Changes (response)
{'AssociatedResources': {'EndBillingPeriod': 'string'}}

List the resources that are associated to a custom line item.

See also: AWS API Documentation

Request Syntax

client.list_resources_associated_to_custom_line_item(
    BillingPeriod='string',
    Arn='string',
    MaxResults=123,
    NextToken='string',
    Filters={
        'Relationship': 'PARENT'|'CHILD'
    }
)
type BillingPeriod

string

param BillingPeriod

The billing period for which the resource associations will be listed.

type Arn

string

param Arn

[REQUIRED]

The ARN of the custom line item for which the resource associations will be listed.

type MaxResults

integer

param MaxResults

(Optional) The maximum number of resource associations to be retrieved.

type NextToken

string

param NextToken

(Optional) The pagination token that's returned by a previous request.

type Filters

dict

param Filters

(Optional) A ListResourcesAssociatedToCustomLineItemFilter that can specify the types of resources that should be retrieved.

  • Relationship (string) --

    The type of relationship between the custom line item and the associated resource.

rtype

dict

returns

Response Syntax

{
    'Arn': 'string',
    'AssociatedResources': [
        {
            'Arn': 'string',
            'Relationship': 'PARENT'|'CHILD',
            'EndBillingPeriod': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Arn (string) --

      The custom line item ARN for which the resource associations are listed.

    • AssociatedResources (list) --

      A list of ListResourcesAssociatedToCustomLineItemResponseElement for each resource association retrieved.

      • (dict) --

        A representation of a resource association for a custom line item.

        • Arn (string) --

          The ARN of the associated resource.

        • Relationship (string) --

          The type of relationship between the custom line item and the associated resource.

        • EndBillingPeriod (string) --

          The end billing period of the associated resource.

    • NextToken (string) --

      The pagination token to be used in subsequent requests to retrieve additional results.