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.
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' } } )
string
[REQUIRED]
The Amazon Resource Name (ARN) for the custom line item.
integer
The maximum number of custom line item versions to retrieve.
string
The pagination token that's used on subsequent calls to retrieve custom line item versions.
dict
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.
dict
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.
{'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' } )
string
[REQUIRED]
A percentage custom line item ARN to associate the resources to.
list
[REQUIRED]
A list containing the ARNs of the resources to be associated.
(string) --
dict
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.
dict
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.
{'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' } )
string
[REQUIRED]
A percentage custom line item ARN to disassociate the resources from.
list
[REQUIRED]
A list containing the ARNs of resources to be disassociated.
(string) --
dict
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.
dict
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.
{'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' } )
string
The billing period for which the resource associations will be listed.
string
[REQUIRED]
The ARN of the custom line item for which the resource associations will be listed.
integer
(Optional) The maximum number of resource associations to be retrieved.
string
(Optional) The pagination token that's returned by a previous request.
dict
(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.
dict
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.