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 Function

RemoteMountBackend.list()

Return Object

ListIterator<RemoteMountBackend>

Authorization Requirement

Available to all authenticated keys or sessions.

Additional Arguments

Example Request

import com.files.ListIterator;
import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.RemoteMountBackend;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  ListIterator<RemoteMountBackend> remoteMountBackends = RemoteMountBackend.list(parameters);
  for (RemoteMountBackend remoteMountBackend : remoteMountBackends.listAutoPaging()) {
    // Operate on remoteMountBackend
  }
} 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());
}

Show Remote Mount Backend

SDK Function

RemoteMountBackend.find()

Return Object

RemoteMountBackend

Authorization Requirement

Available to all authenticated keys or sessions.

Function Arguments

ArgumentDescription
id
int64
Required
Remote Mount Backend ID.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.RemoteMountBackend;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  RemoteMountBackend remoteMountBackend = RemoteMountBackend.find(id, parameters);
  // Operate on remoteMountBackend
} 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());
}

Create Remote Mount Backend

SDK Function

RemoteMountBackend.create()

Return Object

RemoteMountBackend

Authorization Requirement

Available to all authenticated keys or sessions.

Function Arguments

ArgumentDefaultDescription
enabled
boolean
trueTrue if this backend is enabled.
fall
int64
1Number of consecutive failures before considering the backend unhealthy.
health_check_enabled
boolean
trueTrue if health checks are enabled for this backend.
health_check_type
string
"active"Type of health check to perform.
Possible values: active, passive
interval
int64
60Interval in seconds between health checks.
min_free_cpu
double
Minimum free CPU percentage required for this backend to be considered healthy.
min_free_mem
double
Minimum free memory percentage required for this backend to be considered healthy.
priority
int64
1Priority of this backend.
remote_path
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.
canary_file_path
string
Required
Path to the canary file used for health checks.
remote_server_mount_id
int64
Required
The mount ID of the Remote Server Mount that this backend is associated with.
remote_server_id
int64
Required
The remote server that this backend is associated with.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.RemoteMountBackend;

try {
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("canary_file_path", "backend1.txt");
  parameters.put("remote_server_mount_id", 1);
  parameters.put("remote_server_id", 1);
  
  RemoteMountBackend remoteMountBackend = RemoteMountBackend.create(parameters);
  // Operate on remoteMountBackend
} 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());
}

Reset backend status to healthy

SDK Function

remoteMountBackend.resetStatus();

Return Object

No return value.

Authorization Requirement

Available to all authenticated keys or sessions.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.RemoteMountBackend;

try {
  // Find the remoteMountBackend object by its id.
  RemoteMountBackend remoteMountBackend = RemoteMountBackend.find(id, null);
  remoteMountBackend.resetStatus(null);
} 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());
}

Update Remote Mount Backend

SDK Function

remoteMountBackend.update();

Return Object

RemoteMountBackend

Authorization Requirement

Available to all authenticated keys or sessions.

Attribute Setters

SetterDescription
setEnabled
boolean
True if this backend is enabled.
setFall
int64
Number of consecutive failures before considering the backend unhealthy.
setHealthCheckEnabled
boolean
True if health checks are enabled for this backend.
setHealthCheckType
string
Type of health check to perform.
Possible values: active, passive
setInterval
int64
Interval in seconds between health checks.
setMinFreeCpu
double
Minimum free CPU percentage required for this backend to be considered healthy.
setMinFreeMem
double
Minimum free memory percentage required for this backend to be considered healthy.
setPriority
int64
Priority of this backend.
setRemotePath
string
Path on the remote server to treat as the root of this mount.
setRise
int64
Number of consecutive successes before considering the backend healthy.
setCanaryFilePath
string
Path to the canary file used for health checks.
setRemoteServerId
int64
The remote server that this backend is associated with.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.RemoteMountBackend;

try {
  // Find the remoteMountBackend object by its id.
  RemoteMountBackend remoteMountBackend = RemoteMountBackend.find(id, null);
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("enabled", true);
  remoteMountBackend.update(parameters);
} 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());
}

Delete Remote Mount Backend

SDK Function

remoteMountBackend.delete();

Return Object

No return value.

Authorization Requirement

Available to all authenticated keys or sessions.

Example Request

import com.files.exceptions.*;
import com.files.exceptions.ApiErrorException.*;
import com.files.models.RemoteMountBackend;

try {
  // Find the remoteMountBackend object by its id.
  RemoteMountBackend remoteMountBackend = RemoteMountBackend.find(id, null);
  remoteMountBackend.delete(null);
} 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 RemoteMountBackend Object

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

AttributeDescription
canary_file_path
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.
health_check_enabled
boolean
True if health checks are enabled for this backend.
health_check_results
array(object)
Array of recent health check results.
health_check_type
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.
min_free_cpu
decimal
Minimum free CPU percentage required for this backend to be considered healthy.
min_free_mem
decimal
Minimum free memory percentage required for this backend to be considered healthy.
priority
int64
Priority of this backend.
remote_path
string
Path on the remote server to treat as the root of this mount.
remote_server_id
int64
The remote server that this backend is associated with.
remote_server_mount_id
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
undergoing_maintenance
boolean
True if this backend is undergoing maintenance.