utils.usage

Utils for collecting and sending Azure usage data.

Functions

combine_items(item_to_update, other_item)

Update one Usage with the cost, etc.

compress_items(items)

Compress a list of usage items into a single item by combining them.

date_range(start_date, end_date)

Yield a datetime day for each day between start_date and end_date (inclusive).

get_all_usage(start_date, end_date, ...[, ...])

Get Azure usage data for a subscription between start_time and end_time.

retrieve_and_send_usage(hostname_or_ip, ...)

Retrieve usage data from Azure and send it to the API.

retrieve_usage(usage_urls)

Retrieve usage data from Azure.

send_usage(hostname_or_ip, all_item_list, ...)

Post each item of usage_data to a route.

us_date_to_iso(us_date)

Convert a '04/17/1990' string to '1990-04-17'.

usage_row_to_usage_model(item_dict)

Convert a Legacy or Modern UsageDetail to a Usage model.