Billing reference
The Billing
class is designed to provide oversight and management of costs
associated with cloud provider accounts utilized by Edge. This class facilitates
the tracking of both internal and external expenses incurred through the use of
Edge and the applications deployed within the account. It offers the capability
to aggregate costs by organization and service type, providing a granular view
into spending patterns. Additionally, server administrators have the
functionality to download comprehensive reports on these costs.
# Query cloud usage
[1]: edge.billing.query_cloud_usage(billing_date=date(2024, 1, 1))
[<edge.edge_billing.BillingCloudUsage>]
# Query computed costs
[2]: edge.billing.query_computed_costs(billing_date=date(2024, 1, 1))
[<edge.edge_billing.BillingComputedCost>]
Constructor
Constructing these yourself is not recommended. You should make an
EdgeSession and access the .billing
property.
Methods
query_cloud_usage
query_cloud_usage(usage_type=None, classification=None, service=None,
billing_date=None, date_range=None, start_after_id=None, page_size=1000) -> BillingCloudUsage
Query cloud usage for this organization.
Parameters
- usage_type (str)
Optional; A usage type to filter for. - classification (str)
Optional; A classification to filter for. - service (str)
Optional; A service to filter for. - billing_date (date)
Optional; A billing_date to filter for. Mutually exclusive with date_range. - date_range (edge.edge_billing.DateRange)
Optional; A date range to filter for. Mutually exclusive with billing_date. - start_after_id (int)
Optional; A cloud usage ID to return query results after, for pagination. - page_size (int)
Optional; A page size for paginated results. Default is 1000. Minimum is 100 and maximum is 10000.
Returns
edge.edge_billing.BillingCloudUsage Cloud Usage result.
query_computed_costs
query_computed_costs(usage_type=None, classification=None, service=None,
category=None, billing_date=None, include_unallocated=False, date_range=None,
start_after_id=None, page_size) -> BillingComputedCost
Query cloud usage for this organization.
Parameters
- usage_type (str)
Optional; A usage type to filter for. - classification (str)
Optional; A classification to filter for. - service (str)
Optional; A service to filter for. - category (str)
Optional; A category to filter for. - billing_date (date)
Optional; A billing_date to filter for. Mutually exclusive with date_range. - include_unallocated (bool)
Optional; Whether or not to include unallocated costs. This option may only be True if you are a server admin. - date_range (edge.edge_billing.DateRange)
Optional; A date range to filter for. Mutually exclusive with billing_date. - start_after_id (int)
Optional; A cloud usage ID to return query results after, for pagination. - page_size (int)
Optional; A page size for paginated results. Default is 1000. Minimum is 100 and maximum is 10000.
Returns
edge.edge_billing.BillingComputedCost Computed Cost result.