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 (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    bandwidth_snapshot "github.com/Files-com/files-sdk-go/v3/bandwidthsnapshot"
)

bandwidthSnapshotIterator, err := bandwidth_snapshot.List(files_sdk.BandwidthSnapshotListParams{})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

for bandwidthSnapshotIterator.Next() {
    bandwidthSnapshot := bandwidthSnapshotIterator.bandwidthSnapshot()
}
err = bandwidthSnapshotIterator.Err()
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

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
BytesReceived
int64
Site bandwidth report bytes received
BytesSent
int64
Site bandwidth report bytes sent
SyncBytesReceived
int64
Site sync bandwidth report bytes received
SyncBytesSent
int64
Site sync bandwidth report bytes sent
RequestsGet
int64
Site bandwidth report get requests
RequestsPut
int64
Site bandwidth report put requests
RequestsOther
int64
Site bandwidth report other requests
LoggedAt
date-time
Time the site bandwidth report was logged