Billing ******* Client ====== class Billing.Client A low-level client representing AWS Billing You can use the Billing API to programatically list the billing views available to you for a given time period. A billing view represents a set of billing data. The Billing API provides the following endpoint: "https://billing.us-east-1.api.aws" import boto3 client = boto3.client('billing') These are the available methods: * can_paginate * close * create_billing_view * delete_billing_view * get_billing_view * get_paginator * get_resource_policy * get_waiter * list_billing_views * list_source_views_for_billing_view * list_tags_for_resource * tag_resource * untag_resource * update_billing_view Paginators ========== Paginators are available on a client instance via the "get_paginator" method. For more detailed instructions and examples on the usage of paginators, see the paginators user guide. The available paginators are: * ListBillingViews * ListSourceViewsForBillingView Billing / Paginator / ListBillingViews ListBillingViews **************** class Billing.Paginator.ListBillingViews paginator = client.get_paginator('list_billing_views') paginate(**kwargs) Creates an iterator that will paginate through responses from "Billing.Client.list_billing_views()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( activeTimeRange={ 'activeAfterInclusive': datetime(2015, 1, 1), 'activeBeforeInclusive': datetime(2015, 1, 1) }, arns=[ 'string', ], billingViewTypes=[ 'PRIMARY'|'BILLING_GROUP'|'CUSTOM', ], ownerAccountId='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **activeTimeRange** (*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. * **arns** (*list*) -- The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. * *(string) --* * **billingViewTypes** (*list*) -- The type of billing view. * *(string) --* * **ownerAccountId** (*string*) -- The list of owners of the billing view. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **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) --* A token to resume pagination. Billing / Paginator / ListSourceViewsForBillingView ListSourceViewsForBillingView ***************************** class Billing.Paginator.ListSourceViewsForBillingView paginator = client.get_paginator('list_source_views_for_billing_view') paginate(**kwargs) Creates an iterator that will paginate through responses from "Billing.Client.list_source_views_for_billing_view()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( arn='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **arn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **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) --* A token to resume pagination. Billing / Client / get_paginator get_paginator ************* Billing.Client.get_paginator(operation_name) Create a paginator for an operation. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Raises: **OperationNotPageableError** -- Raised if the operation is not pageable. You can use the "client.can_paginate" method to check if an operation is pageable. Return type: "botocore.paginate.Paginator" Returns: A paginator object. Billing / Client / get_billing_view get_billing_view **************** Billing.Client.get_billing_view(**kwargs) Returns the metadata associated to the specified billing view ARN. See also: AWS API Documentation **Request Syntax** response = client.get_billing_view( arn='string' ) Parameters: **arn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. Return type: dict Returns: **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. **Exceptions** * "Billing.Client.exceptions.ThrottlingException" * "Billing.Client.exceptions.ResourceNotFoundException" * "Billing.Client.exceptions.AccessDeniedException" * "Billing.Client.exceptions.ValidationException" * "Billing.Client.exceptions.InternalServerException" Billing / Client / create_billing_view create_billing_view ******************* Billing.Client.create_billing_view(**kwargs) Creates a billing view with the specified billing view attributes. See also: AWS API Documentation **Request Syntax** response = 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' }, ] ) Parameters: * **name** (*string*) -- **[REQUIRED]** The name of the billing view. * **description** (*string*) -- The description of the billing view. * **sourceViews** (*list*) -- **[REQUIRED]** A list of billing views used as the data source for the custom billing view. * *(string) --* * **dataFilterExpression** (*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) --* * **clientToken** (*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. * **resourceTags** (*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. Return type: dict Returns: **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. **Exceptions** * "Billing.Client.exceptions.ServiceQuotaExceededException" * "Billing.Client.exceptions.ThrottlingException" * "Billing.Client.exceptions.AccessDeniedException" * "Billing.Client.exceptions.ConflictException" * "Billing.Client.exceptions.ValidationException" * "Billing.Client.exceptions.InternalServerException" Billing / Client / can_paginate can_paginate ************ Billing.Client.can_paginate(operation_name) Check if an operation can be paginated. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Returns: "True" if the operation can be paginated, "False" otherwise. Billing / Client / list_tags_for_resource list_tags_for_resource ********************** Billing.Client.list_tags_for_resource(**kwargs) Lists tags associated with the billing view resource. See also: AWS API Documentation **Request Syntax** response = client.list_tags_for_resource( resourceArn='string' ) Parameters: **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the resource. Return type: dict Returns: **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. **Exceptions** * "Billing.Client.exceptions.ThrottlingException" * "Billing.Client.exceptions.ResourceNotFoundException" * "Billing.Client.exceptions.AccessDeniedException" * "Billing.Client.exceptions.ValidationException" * "Billing.Client.exceptions.InternalServerException" Billing / Client / update_billing_view update_billing_view ******************* Billing.Client.update_billing_view(**kwargs) An API to update the attributes of the billing view. See also: AWS API Documentation **Request Syntax** response = client.update_billing_view( arn='string', name='string', description='string', dataFilterExpression={ 'dimensions': { 'key': 'LINKED_ACCOUNT', 'values': [ 'string', ] }, 'tags': { 'key': 'string', 'values': [ 'string', ] } } ) Parameters: * **arn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. * **name** (*string*) -- The name of the billing view. * **description** (*string*) -- The description 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) --* **[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) --* Return type: dict Returns: **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. **Exceptions** * "Billing.Client.exceptions.ServiceQuotaExceededException" * "Billing.Client.exceptions.ThrottlingException" * "Billing.Client.exceptions.ResourceNotFoundException" * "Billing.Client.exceptions.AccessDeniedException" * "Billing.Client.exceptions.ConflictException" * "Billing.Client.exceptions.ValidationException" * "Billing.Client.exceptions.InternalServerException" Billing / Client / untag_resource untag_resource ************** Billing.Client.untag_resource(**kwargs) 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** response = client.untag_resource( resourceArn='string', resourceTagKeys=[ 'string', ] ) Parameters: * **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the resource. * **resourceTagKeys** (*list*) -- **[REQUIRED]** A list of tag key value pairs that are associated with the resource. * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Billing.Client.exceptions.ThrottlingException" * "Billing.Client.exceptions.ResourceNotFoundException" * "Billing.Client.exceptions.AccessDeniedException" * "Billing.Client.exceptions.ValidationException" * "Billing.Client.exceptions.InternalServerException" Billing / Client / get_waiter get_waiter ********** Billing.Client.get_waiter(waiter_name) Returns an object that can wait for some condition. Parameters: **waiter_name** (*str*) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. Returns: The specified waiter object. Return type: "botocore.waiter.Waiter" Billing / Client / close close ***** Billing.Client.close() Closes underlying endpoint connections. Billing / Client / get_resource_policy get_resource_policy ******************* Billing.Client.get_resource_policy(**kwargs) Returns the resource-based policy document attached to the resource in "JSON" format. See also: AWS API Documentation **Request Syntax** response = client.get_resource_policy( resourceArn='string' ) Parameters: **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the billing view resource to which the policy is attached to. Return type: dict Returns: **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. **Exceptions** * "Billing.Client.exceptions.ThrottlingException" * "Billing.Client.exceptions.ResourceNotFoundException" * "Billing.Client.exceptions.AccessDeniedException" * "Billing.Client.exceptions.ValidationException" * "Billing.Client.exceptions.InternalServerException" Billing / Client / list_source_views_for_billing_view list_source_views_for_billing_view ********************************** Billing.Client.list_source_views_for_billing_view(**kwargs) Lists the source views (managed Amazon Web Services billing views) associated with the billing view. See also: AWS API Documentation **Request Syntax** response = client.list_source_views_for_billing_view( arn='string', maxResults=123, nextToken='string' ) Parameters: * **arn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. * **maxResults** (*integer*) -- The number of entries a paginated response contains. * **nextToken** (*string*) -- The pagination token that is used on subsequent calls to list billing views. Return type: dict Returns: **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. **Exceptions** * "Billing.Client.exceptions.ThrottlingException" * "Billing.Client.exceptions.ResourceNotFoundException" * "Billing.Client.exceptions.AccessDeniedException" * "Billing.Client.exceptions.ValidationException" * "Billing.Client.exceptions.InternalServerException" Billing / Client / delete_billing_view delete_billing_view ******************* Billing.Client.delete_billing_view(**kwargs) Deletes the specified billing view. See also: AWS API Documentation **Request Syntax** response = client.delete_billing_view( arn='string' ) Parameters: **arn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. Return type: dict Returns: **Response Syntax** { 'arn': 'string' } **Response Structure** * *(dict) --* * **arn** *(string) --* The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. **Exceptions** * "Billing.Client.exceptions.ThrottlingException" * "Billing.Client.exceptions.AccessDeniedException" * "Billing.Client.exceptions.ConflictException" * "Billing.Client.exceptions.ValidationException" * "Billing.Client.exceptions.InternalServerException" Billing / Client / tag_resource tag_resource ************ Billing.Client.tag_resource(**kwargs) An API operation for adding one or more tags (key-value pairs) to a resource. See also: AWS API Documentation **Request Syntax** response = client.tag_resource( resourceArn='string', resourceTags=[ { 'key': 'string', 'value': 'string' }, ] ) Parameters: * **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the resource. * **resourceTags** (*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. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "Billing.Client.exceptions.ThrottlingException" * "Billing.Client.exceptions.ResourceNotFoundException" * "Billing.Client.exceptions.AccessDeniedException" * "Billing.Client.exceptions.ValidationException" * "Billing.Client.exceptions.InternalServerException" Billing / Client / list_billing_views list_billing_views ****************** Billing.Client.list_billing_views(**kwargs) 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** response = 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' ) Parameters: * **activeTimeRange** (*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. * **arns** (*list*) -- The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. * *(string) --* * **billingViewTypes** (*list*) -- The type of billing view. * *(string) --* * **ownerAccountId** (*string*) -- The list of owners of the billing view. * **maxResults** (*integer*) -- The maximum number of billing views to retrieve. Default is 100. * **nextToken** (*string*) -- The pagination token that is used on subsequent calls to list billing views. Return type: dict Returns: **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. **Exceptions** * "Billing.Client.exceptions.ThrottlingException" * "Billing.Client.exceptions.AccessDeniedException" * "Billing.Client.exceptions.ValidationException" * "Billing.Client.exceptions.InternalServerException"