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 Function

UsageSnapshot.list()

Return Object

ListIterator<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 com.files.ListIterator;
import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.UsageSnapshot;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  ListIterator<UsageSnapshot> usageSnapshots = UsageSnapshot.list(parameters);
  for (UsageSnapshot usageSnapshot : usageSnapshots.listAutoPaging()) {
    // Operate on usageSnapshot
  }
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

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

SDK Function

Site.getUsage()

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 com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.Site;
import com.files.models.UsageSnapshot;

try {
  UsageSnapshot usageSnapshot = Site.getUsage();
  // Operate on usageSnapshot
} catch (NotAuthenticatedException e) {
  System.out.println("Authentication Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
} catch (SdkException e) {
  System.out.println("Unknown Error Occurred (" + e.getClass().getName() + "): " + e.getMessage());
}

The UsageSnapshot Object

Some of the functions 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)