File Migration Logs

A FileMigrationLog is an audit log for monitoring and troubleshooting File Migrations in your site.

Logs available through this endpoint are retained for 6 months, after which they are automatically discarded. For longer retention, use Files.com SIEM integrations to stream logs in real time to your preferred SIEM, or configure SIEM streaming to a file.

List File Migration Logs

SDK Method

file_migration_log.List()

Return Values

Returns a *file_migration_log.Iter and an error. Range over All() to receive files_sdk.FileMigrationLog values and errors. Check each loop error before using its resource. Next() and Err() remain supported.

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    file_migration_log "github.com/Files-com/files-sdk-go/v3/filemigrationlog"
)

fileMigrationLogIterator, err := file_migration_log.List(files_sdk.FileMigrationLogListParams{})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}

for fileMigrationLog, err := range fileMigrationLogIterator.All() {
    if err != nil {
        var respErr files_sdk.ResponseError
        if errors.As(err, &respErr) {
            fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
        } else {
            fmt.Printf("Request failed: %v\n", err)
        }
        return
    }
    fmt.Println(fileMigrationLog)
}

The FileMigrationLog Object

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

AttributeDescription
Timestamp
date-time
Start Time of Action. Deprecrated: Use created_at.
FileMigrationId
int64
File Migration ID
DestPath
string
Destination path, for moves and copies
ErrorType
string
Error type, if applicable
Message
string
Message
Operation
string
Operation type
Possible values: copy, delete, delete_for_overwrite, mkdir, move, organize, regional_migration
Path
string
File path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
Status
string
Status
Possible values: success, failure, skipped, retried_failure
CreatedAt
date-time
Start Time of Action