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. 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 | ||||
---|---|---|---|---|
|
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: the licence key; i.e., "softnas"
...
hardware 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 the license agreement (to enable use of the product).
EXAMPLE:
softnas-cmd ackagreement
checkupdate
Check to see if new software updates are available.
EXAMPLE:
softnas-cmd internallicense
executeupdate
Execute and apply software updates.
EXAMPLE:
softnas-cmd executeupdate
statusupdate
Return the status of an update that is in-progress (started by executeupdate).
EXAMPLE:
softnas-cmd statusupdate
availabledisks
Returns list of available disk devices.
EXAMPLE:
softnas-cmd availabledisks
pools
Lists available storage pools.
COMMAND OPTIONS:
start: position to start from (used for pagination)
limit: number of items to get
EXAMPLE:
softnas-cmd pools 1 10
pooldetails
List a storage pool's detailed attributes.
COMMAND OPTIONS:
pool name: the pool name
EXAMPLE:
softnas-cmd pooldetails pool1
poolcommand
issue Issue a command to control a storage pool.
COMMAND OPTIONS:
command name name: zpool command name (startscrub, stopscrub, setonline, setoffline, removedevice, replacedevice)
pool name name: the pool name
EXAMPLE:
softnas-cmd poolcommand <command> [arguments]
...
deletepool
delete Delete pool storage.
COMMAND OPTIONS:
pool name name: the pool name
EXAMPLE:
softnas-cmd deletepool pool1
...
volumes
volumes list List available storage volumes.
COMMAND OPTIONS:
start start: position to start from (used for pagination)
limit limit: number of items to get
EXAMPLE:
softnas-cmd volumes 1 10
...
createvolume
create volume
Create a volume.
COMMAND OPTIONS:
volvol_name name: name of volume
pool pool: selected pool name
vol_type type: possible values :
- filesystem filesystem: Filesystem (NFS, CIFS)
- blockdevice blockdevice: Block Device (iSCSI LUN)
provisioning provisioning: allocation space type. Possible values :
- thin thin: Thin Provision - dynamically allocate space as it is needed
- thick thick: Thick Provision - preallocate space from storage pool now
reservereserve_space space: volume size (number)
reserve_units units: size unit i.e G (Giga)
compression compression: enable commpression
dedup dedup: enable commpression
shareISCS shareISCS: enable share ISCSI
shareCIFS shareCIFS: enable share CIFS
exportNFS exportNFS: enable export NFS
enable_snapshots: Enable scheduled volume snapshots
schedule_name name: Snapshot schedule name
hourlysnaps hourlysnaps: hourly maximum number of scheduled snapshot
dailysnaps dailysnaps: daily maximum number of scheduled snapshot
weeklysnaps weeklysnaps: weekly maximum number of scheduled snapshot
sync sync: controls the behavior of synchronous requests
- standard standard: standard is the POSIX specified behavior of ensuring all synchronous requests are written to stable storage and all devices are flushed to ensure data is not cached by device controllers (this is the default).
- always always: always causes every file system transaction to be written and flushed before its system call returns. This has a large performance penalty.
- disabled disabled: disabled this disables synchronous requests. File File system transactions are transactions are only committed to stable storage periodically. This option will give the highest performance. However, it is very dangerous as ZFS would be ignoring the synchronous transaction demands of applications such as databases or NFS. Administrators should only use this option when the risks are understood.
...
EXAMPLE:
softnas-cmd createvolume vol_name=volume5 pool=pool3 vol_type=filesystem provisioning=thin exportNFS=on shareCIFS=on dedup=on enable_snapshot=on schedule_name=Default hourlysnaps=5 dailysnaps=10 weeklysnaps=0 sync=always
...
editvolume
edit Edit a volume.
EXAMPLE:
softnas-cmd availabledisks
...
deletevolume
delete Delete a volume.
COMMAND OPTIONS:
volume name: name of volume
pool name : pool name
EXAMPLE:
softnas-cmd deletevolume volume6 pool3
schedulelist
list available schedules
...