2024/12/20 - AWS Billing - 9 new1 updated api methods
Changes Added new API's for defining and fetching Billing Views.
Lists the source views (managed Amazon Web Services billing views) associated with the billing view.
See also: AWS API Documentation
Request Syntax
client.list_source_views_for_billing_view( arn='string', maxResults=123, nextToken='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.
integer
The number of entries a paginated response contains.
string
The pagination token that is used on subsequent calls to list billing views.
dict
Response Syntax
{ 'sourceViews': [ 'string', ], 'nextToken': 'string' }
Response Structure
(dict) --
sourceViews (list) --
A list of billing views used as the data source for the custom billing view.
(string) --
nextToken (string) --
The pagination token that is used on subsequent calls to list billing views.
Returns the resource-based policy document attached to the resource in JSON format.
See also: AWS API Documentation
Request Syntax
client.get_resource_policy( resourceArn='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the billing view resource to which the policy is attached to.
dict
Response Syntax
{ 'resourceArn': 'string', 'policy': 'string' }
Response Structure
(dict) --
resourceArn (string) --
The Amazon Resource Name (ARN) of the billing view resource to which the policy is attached to.
policy (string) --
The resource-based policy document attached to the resource in JSON format.
An API operation for adding one or more tags (key-value pairs) to a resource.
See also: AWS API Documentation
Request Syntax
client.tag_resource( resourceArn='string', resourceTags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the resource.
list
[REQUIRED]
A list of tag key value pairs that are associated with the resource.
(dict) --
The tag structure that contains a tag key and value.
key (string) -- [REQUIRED]
The key that's associated with the tag.
value (string) --
The value that's associated with the tag.
dict
Response Syntax
{}
Response Structure
(dict) --
Returns the metadata associated to the specified billing view ARN.
See also: AWS API Documentation
Request Syntax
client.get_billing_view( arn='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.
dict
Response Syntax
{ 'billingView': { 'arn': 'string', 'name': 'string', 'description': 'string', 'billingViewType': 'PRIMARY'|'BILLING_GROUP'|'CUSTOM', 'ownerAccountId': 'string', 'dataFilterExpression': { 'dimensions': { 'key': 'LINKED_ACCOUNT', 'values': [ 'string', ] }, 'tags': { 'key': 'string', 'values': [ 'string', ] } }, 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1) } }
Response Structure
(dict) --
billingView (dict) --
The billing view element associated with the specified ARN.
arn (string) --
The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.
name (string) --
A list of names of the billing view.
description (string) --
The description of the billing view.
billingViewType (string) --
The type of billing group.
ownerAccountId (string) --
The list of owners of the billing view.
dataFilterExpression (dict) --
See Expression. Billing view only supports LINKED_ACCOUNT and Tags.
dimensions (dict) --
The specific Dimension to use for Expression.
key (string) --
The names of the metadata types that you can use to filter and group your results.
values (list) --
The metadata values that you can use to filter and group your results.
(string) --
tags (dict) --
The specific Tag to use for Expression.
key (string) --
The key for the tag.
values (list) --
The specific value of the tag.
(string) --
createdAt (datetime) --
The time when the billing view was created.
updatedAt (datetime) --
The time when the billing view was last updated.
Lists tags associated with the billing view resource.
See also: AWS API Documentation
Request Syntax
client.list_tags_for_resource( resourceArn='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the resource.
dict
Response Syntax
{ 'resourceTags': [ { 'key': 'string', 'value': 'string' }, ] }
Response Structure
(dict) --
resourceTags (list) --
A list of tag key value pairs that are associated with the resource.
(dict) --
The tag structure that contains a tag key and value.
key (string) --
The key that's associated with the tag.
value (string) --
The value that's associated with the tag.
An API to update the attributes of the billing view.
See also: AWS API Documentation
Request Syntax
client.update_billing_view( arn='string', name='string', description='string', dataFilterExpression={ 'dimensions': { 'key': 'LINKED_ACCOUNT', 'values': [ 'string', ] }, 'tags': { 'key': 'string', 'values': [ 'string', ] } } )
string
[REQUIRED]
The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.
string
The name of the billing view.
string
The description of the billing view.
dict
See Expression. Billing view only supports LINKED_ACCOUNT and Tags.
dimensions (dict) --
The specific Dimension to use for Expression.
key (string) -- [REQUIRED]
The names of the metadata types that you can use to filter and group your results.
values (list) -- [REQUIRED]
The metadata values that you can use to filter and group your results.
(string) --
tags (dict) --
The specific Tag to use for Expression.
key (string) -- [REQUIRED]
The key for the tag.
values (list) -- [REQUIRED]
The specific value of the tag.
(string) --
dict
Response Syntax
{ 'arn': 'string', 'updatedAt': datetime(2015, 1, 1) }
Response Structure
(dict) --
arn (string) --
The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.
updatedAt (datetime) --
The time when the billing view was last updated.
Removes one or more tags from a resource. Specify only tag keys in your request. Don't specify the value.
See also: AWS API Documentation
Request Syntax
client.untag_resource( resourceArn='string', resourceTagKeys=[ 'string', ] )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the resource.
list
[REQUIRED]
A list of tag key value pairs that are associated with the resource.
(string) --
dict
Response Syntax
{}
Response Structure
(dict) --
Creates a billing view with the specified billing view attributes.
See also: AWS API Documentation
Request Syntax
client.create_billing_view( name='string', description='string', sourceViews=[ 'string', ], dataFilterExpression={ 'dimensions': { 'key': 'LINKED_ACCOUNT', 'values': [ 'string', ] }, 'tags': { 'key': 'string', 'values': [ 'string', ] } }, clientToken='string', resourceTags=[ { 'key': 'string', 'value': 'string' }, ] )
string
[REQUIRED]
The name of the billing view.
string
The description of the billing view.
list
[REQUIRED]
A list of billing views used as the data source for the custom billing view.
(string) --
dict
See Expression. Billing view only supports LINKED_ACCOUNT and Tags.
dimensions (dict) --
The specific Dimension to use for Expression.
key (string) -- [REQUIRED]
The names of the metadata types that you can use to filter and group your results.
values (list) -- [REQUIRED]
The metadata values that you can use to filter and group your results.
(string) --
tags (dict) --
The specific Tag to use for Expression.
key (string) -- [REQUIRED]
The key for the tag.
values (list) -- [REQUIRED]
The specific value of the tag.
(string) --
string
A unique, case-sensitive identifier you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. If the original request completes successfully, any subsequent retries complete successfully without performing any further actions with an idempotent request.
This field is autopopulated if not provided.
list
A list of key value map specifying tags associated to the billing view being created.
(dict) --
The tag structure that contains a tag key and value.
key (string) -- [REQUIRED]
The key that's associated with the tag.
value (string) --
The value that's associated with the tag.
dict
Response Syntax
{ 'arn': 'string', 'createdAt': datetime(2015, 1, 1) }
Response Structure
(dict) --
arn (string) --
The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.
createdAt (datetime) --
The time when the billing view was created.
Deletes the specified billing view.
See also: AWS API Documentation
Request Syntax
client.delete_billing_view( arn='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.
dict
Response Syntax
{ 'arn': 'string' }
Response Structure
(dict) --
arn (string) --
The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.
{'arns': ['string'], 'billingViewTypes': ['PRIMARY | BILLING_GROUP | CUSTOM'], 'ownerAccountId': 'string'}Response
{'billingViews': {'billingViewType': {'CUSTOM'}, 'description': 'string'}}
Lists the billing views available for a given time period.
Every Amazon Web Services account has a unique PRIMARY billing view that represents the billing data available by default. Accounts that use Billing Conductor also have BILLING_GROUP billing views representing pro forma costs associated with each created billing group.
See also: AWS API Documentation
Request Syntax
client.list_billing_views( activeTimeRange={ 'activeAfterInclusive': datetime(2015, 1, 1), 'activeBeforeInclusive': datetime(2015, 1, 1) }, arns=[ 'string', ], billingViewTypes=[ 'PRIMARY'|'BILLING_GROUP'|'CUSTOM', ], ownerAccountId='string', maxResults=123, nextToken='string' )
dict
The time range for the billing views listed. PRIMARY billing view is always listed. BILLING_GROUP billing views are listed for time ranges when the associated billing group resource in Billing Conductor is active. The time range must be within one calendar month.
activeAfterInclusive (datetime) -- [REQUIRED]
The inclusive time range start date.
activeBeforeInclusive (datetime) -- [REQUIRED]
The inclusive time range end date.
list
The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.
(string) --
list
The type of billing view.
(string) --
string
The list of owners of the billing view.
integer
The maximum number of billing views to retrieve. Default is 100.
string
The pagination token that is used on subsequent calls to list billing views.
dict
Response Syntax
{ 'billingViews': [ { 'arn': 'string', 'name': 'string', 'description': 'string', 'ownerAccountId': 'string', 'billingViewType': 'PRIMARY'|'BILLING_GROUP'|'CUSTOM' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
billingViews (list) --
A list of BillingViewListElement retrieved.
(dict) --
A representation of a billing view.
arn (string) --
The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.
name (string) --
A list of names of the Billing view.
description (string) --
The description of the billing view.
ownerAccountId (string) --
The list of owners of the Billing view.
billingViewType (string) --
The type of billing view.
nextToken (string) --
The pagination token to use on subsequent calls to list billing views.