Remote Mount Backends

A Remote Mount Backend is used to provide high availability for a Remote Server Mount Folder Behavior.

List Remote Mount Backends

SDK Method

remotemountbackend.List()

Return Object

[]*RemoteMountBackend

Authorization Requirement

Available to all authenticated keys or sessions.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    remote_mount_backend "github.com/Files-com/files-sdk-go/v3/remotemountbackend"
)

remoteMountBackendIterator, err := remote_mount_backend.List(files_sdk.RemoteMountBackendListParams{})
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 remoteMountBackendIterator.Next() {
    remoteMountBackend := remoteMountBackendIterator.remoteMountBackend()
}
err = remoteMountBackendIterator.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())
    }
}

Show Remote Mount Backend

SDK Method

remotemountbackend.Find()

Return Object

RemoteMountBackend

Authorization Requirement

Available to all authenticated keys or sessions.

RemoteMountBackendFindParams Fields

FieldDescription
Id
int64
Required
Remote Mount Backend ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    remote_mount_backend "github.com/Files-com/files-sdk-go/v3/remotemountbackend"
)

remoteMountBackend, err := remote_mount_backend.Find(files_sdk.RemoteMountBackendFindParams{Id: 1})
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())
    }
}

Create Remote Mount Backend

SDK Method

remotemountbackend.Create()

Return Object

RemoteMountBackend

Authorization Requirement

Available to all authenticated keys or sessions.

RemoteMountBackendCreateParams Fields

FieldDefaultDescription
Enabled
boolean
trueTrue if this backend is enabled.
Fall
int64
1Number of consecutive failures before considering the backend unhealthy.
HealthCheckEnabled
boolean
trueTrue if health checks are enabled for this backend.
HealthCheckType
string
"active"Type of health check to perform.
Possible values: active, passive
Interval
int64
60Interval in seconds between health checks.
MinFreeCpu
double
Minimum free CPU percentage required for this backend to be considered healthy.
MinFreeMem
double
Minimum free memory percentage required for this backend to be considered healthy.
Priority
int64
1Priority of this backend.
RemotePath
string
""Path on the remote server to treat as the root of this mount.
Rise
int64
1Number of consecutive successes before considering the backend healthy.
CanaryFilePath
string
Required
Path to the canary file used for health checks.
RemoteServerMountId
int64
Required
The mount ID of the Remote Server Mount that this backend is associated with.
RemoteServerId
int64
Required
The remote server that this backend is associated with.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    remote_mount_backend "github.com/Files-com/files-sdk-go/v3/remotemountbackend"
)

remoteMountBackend, err := remote_mount_backend.Create(files_sdk.RemoteMountBackendCreateParams{
  CanaryFilePath: "backend1.txt",
  RemoteServerMountId: 1,
  RemoteServerId: 1
})
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())
    }
}

Reset backend status to healthy

SDK Method

remotemountbackend.ResetStatus()

Return Object

No return value.

Authorization Requirement

Available to all authenticated keys or sessions.

RemoteMountBackendResetStatusParams Fields

FieldDescription
Id
int64
Required
Remote Mount Backend ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    remote_mount_backend "github.com/Files-com/files-sdk-go/v3/remotemountbackend"
)

err := remote_mount_backend.ResetStatus(files_sdk.RemoteMountBackendResetStatusParams{Id: 1})
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())
    }
}

Update Remote Mount Backend

SDK Method

remotemountbackend.Update()

Return Object

RemoteMountBackend

Authorization Requirement

Available to all authenticated keys or sessions.

RemoteMountBackendUpdateParams Fields

FieldDescription
Id
int64
Required
Remote Mount Backend ID.
Enabled
boolean
True if this backend is enabled.
Fall
int64
Number of consecutive failures before considering the backend unhealthy.
HealthCheckEnabled
boolean
True if health checks are enabled for this backend.
HealthCheckType
string
Type of health check to perform.
Possible values: active, passive
Interval
int64
Interval in seconds between health checks.
MinFreeCpu
double
Minimum free CPU percentage required for this backend to be considered healthy.
MinFreeMem
double
Minimum free memory percentage required for this backend to be considered healthy.
Priority
int64
Priority of this backend.
RemotePath
string
Path on the remote server to treat as the root of this mount.
Rise
int64
Number of consecutive successes before considering the backend healthy.
CanaryFilePath
string
Path to the canary file used for health checks.
RemoteServerId
int64
The remote server that this backend is associated with.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    remote_mount_backend "github.com/Files-com/files-sdk-go/v3/remotemountbackend"
)

remoteMountBackend, err := remote_mount_backend.Update(files_sdk.RemoteMountBackendUpdateParams{
  Id: 1,
  Enabled: lib.Bool(true)
})
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())
    }
}

Delete Remote Mount Backend

SDK Method

remotemountbackend.Delete()

Return Object

No return value.

Authorization Requirement

Available to all authenticated keys or sessions.

RemoteMountBackendDeleteParams Fields

FieldDescription
Id
int64
Required
Remote Mount Backend ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    remote_mount_backend "github.com/Files-com/files-sdk-go/v3/remotemountbackend"
)

err := remote_mount_backend.Delete(files_sdk.RemoteMountBackendDeleteParams{Id: 1})
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 RemoteMountBackend Object

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

AttributeDescription
CanaryFilePath
string
Path to the canary file used for health checks.
Enabled
boolean
True if this backend is enabled.
Fall
int64
Number of consecutive failures before considering the backend unhealthy.
HealthCheckEnabled
boolean
True if health checks are enabled for this backend.
HealthCheckResults
array(object)
Array of recent health check results.
HealthCheckType
string
Type of health check to perform.
Possible values: active, passive
Id
int64
Unique identifier for this backend.
Interval
int64
Interval in seconds between health checks.
MinFreeCpu
decimal
Minimum free CPU percentage required for this backend to be considered healthy.
MinFreeMem
decimal
Minimum free memory percentage required for this backend to be considered healthy.
Priority
int64
Priority of this backend.
RemotePath
string
Path on the remote server to treat as the root of this mount.
RemoteServerId
int64
The remote server that this backend is associated with.
RemoteServerMountId
int64
The mount ID of the Remote Server Mount that this backend is associated with.
Rise
int64
Number of consecutive successes before considering the backend healthy.
Status
string
Status of this backend.
Possible values: healthy, degraded, failed, desynced
UndergoingMaintenance
boolean
True if this backend is undergoing maintenance.