Bandwidth Snapshots

A BandwidthSnapshot is information about site bandwidth usage for the given date.

List Bandwidth Snapshots

SDK Method

BandwidthSnapshot.list()

Return Object

BandwidthSnapshot[]

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 BandwidthSnapshot from 'files.com/lib/models/BandwidthSnapshot';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const bandwidthSnapshots = await BandwidthSnapshot.list();
  for (const bandwidthSnapshot of bandwidthSnapshots) {
    // Operate on bandwidthSnapshot
  }
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

The BandwidthSnapshot Object

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

AttributeDescription
id
int64
Site bandwidth ID
bytes_received
int64
Site bandwidth report bytes received
bytes_sent
int64
Site bandwidth report bytes sent
sync_bytes_received
int64
Site sync bandwidth report bytes received
sync_bytes_sent
int64
Site sync bandwidth report bytes sent
requests_get
int64
Site bandwidth report get requests
requests_put
int64
Site bandwidth report put requests
requests_other
int64
Site bandwidth report other requests
logged_at
date-time
Time the site bandwidth report was logged