Usage Snapshots

A UsageSnapshot is a site-wide utilization report of storage, bandwidth, APIs, and user accounts of your Files.com site for the given time period.

List Usage Snapshots

SDK Method

files_sdk.usage_snapshot.list()

Return Object

ListObj[UsageSnapshot]

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

import files_sdk

try:
  usage_snapshots = files_sdk.usage_snapshot.list()
  for usage_snapshot in usage_snapshots.auto_paging_iter():
    # Operate on usage_snapshot
except files_sdk.error.NotAuthenticatedError as err:
  print(f"Authentication Error Occurred ({type(err).__name__}):", err)
except files_sdk.error.Error as err:
  print(f"Unknown Error Occurred ({type(err).__name__}):", err)

Get the most recent usage snapshot (usage data for billing purposes) for a Site

SDK Method

files_sdk.site.get_usage()

Return Object

UsageSnapshot

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Example Request

import files_sdk

try:
  usage_snapshot = files_sdk.site.get_usage()
  # Operate on usage_snapshot
except files_sdk.error.NotAuthenticatedError as err:
  print(f"Authentication Error Occurred ({type(err).__name__}):", err)
except files_sdk.error.Error as err:
  print(f"Unknown Error Occurred ({type(err).__name__}):", err)

The UsageSnapshot Object

Some of the methods above return a UsageSnapshot object. The attributes of this object are listed below.

AttributeDescription
id
int64
Usage snapshot ID
start_at
date-time
Usage snapshot start date/time
end_at
date-time
Usage snapshot end date/time
high_water_user_count
int64
Highest user count number in time period
transformation_credits_usage
int64
Total Transformation and AI credits used in this usage period. Updated daily. Does not include credits consumed today.
current_storage
int64
Current total Storage Usage GB as of end date (not necessarily high water mark, which is used for billing)
high_water_storage
int64
Highest Storage Usage GB recorded in time period (used for billing)
root_storage
int64
Storage Usage for root folder as of end date (not necessarily high water mark, which is used for billing)
deleted_files_counted_in_minimum
int64
Storage Usage for files that are deleted but uploaded within last 30 days as of end date (not necessarily high water mark, which is used for billing)
deleted_files_storage
int64
Storage Usage for files that are deleted but retained as backups as of end date (not necessarily high water mark, which is used for billing)
total_billable_usage
int64
Storage + Transfer Usage - Total Billable amount
total_billable_transfer_usage
int64
Transfer usage for period - Total Billable amount
bytes_sent
int64
Transfer Usage for period - Outbound GB from Files Native Storage
sync_bytes_received
int64
Transfer Usage for period - Inbound GB to Remote Servers (Sync/Mount)
sync_bytes_sent
int64
Transfer Usage for period - Outbound GB from Remote Servers (Sync/Mount)
usage_by_top_level_dir
array(object)
Storage Usage - map of root folders to their usage as of end date (not necessarily high water mark, which is used for billing)