Overview

NFSops Python SDK.

Storage management for workspaces.

Prerequisites

Note

This package requires rsync executable in the system environment.

Installation

Install package:

pip install nfsops

CLI

List backup versions

nfsops backup list

Restore and merge backup versions

Warning

The backup command always restores the most recent files.

Restore and merge files from all backup versions:

nfsops backup restore *

Restore and merge files from a single backup version:

nfsops backup restore 0

Note

This step will restore the latest backup version.

Restore and merge files from a range of backup versions:

nfsops backup restore 0 4

Note

This step will restore the last 5 backup versions.

nfsops backup restore 5 *

Note

This step will restore all backup versions older than version 5.

Manage multiple backups using root context

Set up the environment variables below:

export NFSOPS_CONTEXT=root
export NFSOPS_ROOT_TEMPLATE=namespace-{name}-resource*
export NFSOPS_PATH=<path>

Or use the CLI options:

nfsops --context root --root-template namespace-{name}-resource* --path <path> backup --name <name> ..

Note

The root template also supports {legacy_escaped_name} placeholder.

Hint

Try nfsops --help for more details.

Logs

Set the NFSOPS_LOG_LEVEL environment variable to define the application log level.

Levels:

  • critical (default)

  • fatal

  • error

  • warn

  • warning

  • info

  • debug

  • notset

SDK

List backup versions

from nfsops import (
    ContextConfiguration,
    BackupConfiguration,
    BackupOperator
)


context = ContextConfiguration()
configuration = BackupConfiguration()
operator = BackupOperator(context, configuration)

operator.list_versions()

Restore and merge backup versions

from nfsops import (
    ContextConfiguration,
    BackupConfiguration,
    RestoreConfiguration,
    BackupOperator
)


context = ContextConfiguration()
configuration = BackupConfiguration()
operator = BackupOperator(context, configuration)

options = RestoreConfiguration(version=0)
operator.restore(options)