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 a command to control a storage pool.
COMMAND OPTIONS:
command name: zpool command name (startscrub, stopscrub, setonline, setoffline, removedevice, replacedevice)
pool name: the pool name
EXAMPLE:
softnas-cmd poolcommand <command> [arguments]
deletepool
Delete pool storage.
COMMAND OPTIONS:
pool name: the pool name
EXAMPLE:
softnas-cmd deletepool pool1
volumes
List available storage volumes.
COMMAND OPTIONS:
start: position to start from (used for pagination)
limit: number of items to get
EXAMPLE:
softnas-cmd volumes 1 10
createvolume
Create a volume.
COMMAND OPTIONS:
vol_name: name of volume
pool: selected pool name
...
- disabled: this disables synchronous requests. File system 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 a volume.
EXAMPLE:
softnas-cmd availabledisks
deletevolume
Delete a volume.
COMMAND OPTIONS:
volume name: name of volume
pool name: pool name
EXAMPLE:
softnas-cmd deletevolume volume6 pool3
...
...
schedulelist
list List available schedules.
EXAMPLE:
softnas-cmd schedulelist
...
...
snapshotlist
list List available snapshots.
COMMAND OPTIONS:
pool name name: pool name i.e 'pool3/vol1'
start start: position to start from (used for pagination)
limit limit: number of items to get
EXAMPLE:
softnas-cmd snapshotlist pool3/vol1 0 10
snapcommand
issue a volume snapshot control command
...