Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The "softnas-cmd" command line interface utility facilitates integration with the REST API as a CLI (command line interface).  softnas-cmd is written in CURL and is cross-platform code. It may also be useful as example code for how to use the API, for those who wish to explore it in more detail as a working example. This document has been produced by running `softnas-cmd --help`.

...

As with all SoftNAS API applications, softnas-cmd requires that you first authenticate with the SoftNAS server using the "login" command.  Once you are logged in, softnas-cmd maintains a simulated cookie jar that emulates how a browser interacts with a web server to maintain session security (required by the SoftNAS server).  Subsequent commands issued via the softnas-cmd CLI make use of the login session (which expires after 30 minutes).

Usage:

softnas-cmd [-h | --help] | [[-b | --base_url URL] [-s | --session_id SESSION_ID]  [-i | --insecure] | [-t | --pretty_print] COMMAND [OPTIONS]]

 

OPTIONS:

    -h [command name], --help [command name]

...

Display json result with indentation.


Commands:

Table of Contents
maxLevel2
minLevel2

login  

Login into SoftNAS Application.

COMMAND OPTIONS:

username

password

EXAMPLE:

softnas-cmd login softnas Pass4W0rd


logout 

Logout from SoftNAS Application.

EXAMPLE:

softnas-cmd logout

resetsessiontimer

This command is used to keep session active. By default session timeout is set to 30 minutes. if you want to keep session from being expired just call this function.    

EXAMPLE:

softnas-cmd resetsessiontimer

licenseinfo

Returns the current license information.  

       

EXAMPLE:

softnas-cmd licenseinfo

...

...


licenseactivate

        Activate a license key for use with SoftNAS       

COMMAND OPTIONS:

            licencekey       licencekey: the licence key; i.e., "softnas"

            register name   name: the registered name of the license key

            hardware id     id: can be obtained from "licenseinfo" in amazon the hardware id is the instance id            

EXAMPLE:

softnas-cmd licenseactivate CEAASA-BESNJA-8MEED6-AHAZZN-XHWB8X-A2NUK3 RBLLC i-0b06fe44

...

...

internallicense

        Force SoftNAS to use its built-in, default license.       


EXAMPLE:

softnas-cmd internallicense

...

...


ackagreement

        acknowledge Acknowledge the license agreement (to enable use of the product).       

EXAMPLE:

softnas-cmd ackagreement

 

    checkupdate

        check to see if new software updates are available

...

    pools   lists available storage pools

        COMMAND OPTIONS Command Options:

            start   : position to start from (used for pagination)

...

        list a storage pool's detailed attributes

        COMMAND OPTIONS Command Options:

            pool name   : the pool name

...

        issue a command to control a storage pool

        COMMAND OPTIONS Command Options:

            command name   : zpool command name (startscrub, stopscrub, setonline, setoffline, removedevice, replacedevice)

...

        delete pool storage

        COMMAND OPTIONS Command Options:

            pool name   : the pool name

...

    volumes list available storage volumes

        COMMAND OPTIONS Command Options:

            start   : position to start from (used for pagination)

...

        create volume

        COMMAND OPTIONS Command Options:

            vol_name        : name of volume

...

        delete volume

        COMMAND OPTIONS Command Options:

            volume name : name of volume

...

        list available snapshots

        COMMAND OPTIONS Command Options:

            pool name   : pool name i.e 'pool3/vol1'

...

        issue a volume snapshot control command

        COMMAND OPTIONS Command Options:

            command : possible values

...

        list of available iSCSI targets

        COMMAND OPTIONS Command Options:

            start       : position to start from (used for pagination)

...

        issue a disk management command

        COMMAND OPTIONS Command Options:

            command : possible values

...

        issue a disk partitioning command

        COMMAND OPTIONS Command Options:

            command : possible values

...

        issue SnapReplicate command

        COMMAND OPTIONS Command Options:

            command : possible values

...

        issue ha command

        COMMAND OPTIONS Command Options:

            command : possible values

...

        creates new storage pool

        COMMAND OPTIONS Command Options:

            disk devices        : list of diskdevices separated by comma ":"

...

        create cache disk devices for pool storage

        COMMAND OPTIONS Command Options:

            disk devices    : list of diskdevices separated by comma ":"

...

        create log disk devices for pool storage

        COMMAND OPTIONS Command Options:

            disk devices    : list of diskdevices separated by comma ":"

...

        add spare disk to storage pool

        COMMAND OPTIONS      Command Options:

            disk devices    : list of diskdevices separated by comma ":"

...

        import deleted or foreign pools

        COMMAND OPTIONS Command Options:

            pool name       : the pool name

...

        issue a EBS snapshots backup command

        COMMAND OPTIONS Command Options:

            command : possible values

...

        mark tiered storage device as enabled (but do not import it)

        COMMAND OPTIONS Command Options:

            name            : human-readable tier name (ex. tierA)

...

        mark tiered storage device as disabled (but do not export it)

        COMMAND OPTIONS Command Options:

            name            : human-readable tier name (ex. tierA)

...

        stop tiered storage device if it is not in use without marking as disabled (will auto-import on reboot or takeover)

        COMMAND OPTIONS Command Options:

            name            : human-readable tier name (ex. tierA)

...

        activate an exported tier storage device

        COMMAND OPTIONS Command Options:

            name            : human-readable tier name (ex. tierA)

...

        display current storage migration policy JSON document

        COMMAND OPTIONS Command Options:

            name            : human-readable tier name (ex. tierA)

...

        apply new storage migration policy

        COMMAND OPTIONS Command Options:

            name            : human-readable tier name (ex. tierA)

...

        expand tiered storage device when underlying volumes have grown

        COMMAND OPTIONS Command Options:

            name            : human-readable tier name (ex. tierA)

...

        Display help text

        COMMAND OPTIONS Command Options:

            command name : Optional. You can add softnas command name to get the only help of it

...