SoftNAS API Guide
Menu
Index
  • 4. Command Reference

4. Command Reference

 
1.1.     Command Reference Operations
 
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.
 
The softnas-cmd CLI is designed to be used from the command line. When running within the Amazon Web Services (AWS) environment, softnas-cli is a convenient tool for use with Cloud Formation templates, which can be combined to automate configuration and setup of SoftNAS storage systems.
 
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).
 

Where to get Softnas-cmd CLI program

 
The "softnas-cmd" CLI is located in the SoftNAS install directory /var/www/softnas/api.  It is also installed by default into /usr/local/bin on the SoftNAS storage server for local use.
 
It is also available for download from the product documentation page here.  Download the zip file, then unzip the "softnas-cmd" file.  Make sure you have CURL installed.
 

Installing CURL

 
Linux: To install CURL on CentOS/RHEL:  yum install curl (or use appropriate installer on your version of Linux)
 
 
 
For more information on CURL, visit the CURL website.
 
 

Available CLI commands

 
This section Provides basic information of the SoftNAS command line interface and also provides the list of available commands, which correspond to related API calls.
 
You can use the "Pretty Print" command line option to format the JSON string responses for better human readability (the raw JSON is printed by default).
 
 
 
 
Made with help of Dr.Explain