Billing / Client / get_billing_preferences
get_billing_preferences¶
- Billing.Client.get_billing_preferences(**kwargs)¶
Retrieves billing preferences for the specified feature. Each feature controls a distinct billing capability: which accounts can share Reserved Instances or credits, whether billing alerts are enabled, the historical record of sharing changes, and per-credit options.
See also: AWS API Documentation
Request Syntax
response = client.get_billing_preferences( nextToken='string', maxResults=123, features=[ 'RI_SHARING'|'RI_SHARING_HISTORY'|'CREDIT_SHARING'|'CREDIT_SHARING_HISTORY'|'CREDIT_LEVEL_SHARING'|'BILLING_ALERTS'|'CREDIT_PREFERENCE_OPTIONS', ], filters=[ { 'name': 'PREFERENCE_KEY', 'value': [ 'string', ] }, ] )
- Parameters:
nextToken (string) – Pagination token from a previous response. Pass the value returned in
nextTokento retrieve the next page of results.maxResults (integer) – The maximum number of records to return per page. Range: 1 to 50. Default: 50.
features (list) –
[REQUIRED]
The feature to retrieve. Specify exactly one value. Valid values:
BILLING_ALERTS,RI_SHARING,RI_SHARING_HISTORY,CREDIT_SHARING,CREDIT_SHARING_HISTORY,CREDIT_LEVEL_SHARING,CREDIT_PREFERENCE_OPTIONS.(string) –
filters (list) –
Filters to narrow results. Specify exactly one filter when supplied. The supported filter name is
PREFERENCE_KEY, which accepts 1 to 10 values to match preference keys.(dict) –
A filter that narrows the set of preferences returned by
GetBillingPreferences.name (string) –
The filter name. Currently the only supported value is
PREFERENCE_KEY.value (list) –
The filter values to match. For
PREFERENCE_KEY, supply 1 to 10 preference key values to match.(string) –
- Return type:
dict
- Returns:
Response Syntax
{ 'billingPreferences': [ { 'feature': 'RI_SHARING'|'RI_SHARING_HISTORY'|'CREDIT_SHARING'|'CREDIT_SHARING_HISTORY'|'CREDIT_LEVEL_SHARING'|'BILLING_ALERTS'|'CREDIT_PREFERENCE_OPTIONS', 'key': 'string', 'value': 'ENABLED'|'DISABLED', 'accountName': 'string', 'accountId': 'string', 'billingPeriod': { 'year': 123, 'month': 123 } }, ], 'nextToken': 'string' }
Response Structure
(dict) –
billingPreferences (list) –
The list of preference entries matching the request.
(dict) –
A single billing preference entry returned by
GetBillingPreferences.feature (string) –
The feature this preference belongs to.
key (string) –
The preference key. Format depends on the feature.
value (string) –
The preference value. Valid values:
ENABLEDorDISABLED.accountName (string) –
The display name of the account. Populated together with
accountId;nullotherwise.accountId (string) –
The associated Amazon Web Services account ID. Populated for account-list keys;
nullotherwise.billingPeriod (dict) –
The billing period associated with the preference change. Populated only for the history features
RI_SHARING_HISTORYandCREDIT_SHARING_HISTORY.year (integer) –
The four-digit year of the billing period.
month (integer) –
The month of the billing period as an integer between 1 and 12.
nextToken (string) –
Pagination token. Present when more pages are available;
nullwhen there are no more results.
Exceptions