System

Resources related to system.

Advanced

The Advanced resource represents the advanced settings.

List resource

GET /api/v1.0/system/advanced/

Returns the advanced dictionary.

Example request:

GET /api/v1.0/ssytem/advanced/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "adv_serialconsole": false,
          "adv_traceback": true,
          "adv_uploadcrash": true,
          "adv_consolescreensaver": false,
          "adv_debugkernel": false,
          "adv_advancedmode": false,
          "adv_consolemsg": false,
          "adv_anonstats": true,
          "adv_autotune": false,
          "adv_powerdaemon": false,
          "adv_swapondrive": 2,
          "adv_anonstats_token": "",
          "adv_motd": "Welcome to FreeNAS",
          "adv_consolemenu": true,
          "id": 1,
          "adv_serialport": "0x2f8"
          "adv_serialspeed": "9600"
  }
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Update resource

PUT /api/v1.0/system/advanced/

Update advanced.

Example request:

PUT /api/v1.0/system/advanced/ HTTP/1.1
Content-Type: application/json

  {
          "adv_powerdaemon": true
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "adv_serialconsole": false,
          "adv_traceback": true,
          "adv_uploadcrash": true,
          "adv_consolescreensaver": false,
          "adv_debugkernel": false,
          "adv_advancedmode": false,
          "adv_consolemsg": false,
          "adv_anonstats": true,
          "adv_autotune": false,
          "adv_powerdaemon": true,
          "adv_swapondrive": 2,
          "adv_anonstats_token": "",
          "adv_motd": "Welcome to FreeNAS",
          "adv_consolemenu": true,
          "id": 1,
          "adv_serialport": "0x2f8"
          "adv_serialspeed": "9600"
  }
Json Parameters:
 
  • adv_consolemenu (boolean) – Enable Console Menu
  • adv_serialconsole (boolean) – Use Serial Console
  • adv_serialport (string) – 0x2f8, 0x3f8
  • adv_serialspeed (string) – 9600, 19200, 38400, 57600, 115200
  • adv_consolescreensaver (boolean) – Enable screen saver
  • adv_powerdaemon (boolean) – Enable powerd (Power Saving Daemon)
  • adv_swapondrive (string) – Swap size on each drive in GiB, affects new disks only
  • adv_consolemsg (boolean) – Show console messages in the footer
  • adv_traceback (boolean) – Show tracebacks in case of fatal errors
  • adv_uploadcrash (boolean) – Upload kernel crashes to analysis
  • adv_advancedmode (boolean) – Show advanced fields by default
  • adv_autotune (boolean) – Enable autotune
  • adv_debugkernel (boolean) – Enable debug kernel
  • adv_motd (string) – MOTD banner
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Alert

The Alert resource represents system alerts.

List resource

GET /api/v1.0/system/alert/

Returns a list of system alerts.

Example request:

GET /api/v1.0/system/alert/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  [{
          "id": "256ad2f48e5e541e28388701e34409cc",
          "level": "OK",
          "message": "The volume tank (ZFS) status is HEALTHY"
  }]
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

CronJob

The CronJob resource represents cron(8) to execute scheduled commands.

List resource

GET /api/v1.0/system/cronjob/

Returns a list of all cronjobs.

Example request:

GET /api/v1.0/system/cronjob/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "cron_command": "touch /tmp/xx",
          "cron_daymonth": "*",
          "cron_dayweek": "*",
          "cron_description": "",
          "cron_enabled": true,
          "cron_hour": "*",
          "cron_minute": "*",
          "cron_month": "1,2,3,4,6,7,8,9,10,11,12",
          "cron_stderr": false,
          "cron_stdout": true,
          "cron_user": "root",
          "id": 1
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 30
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/system/cronjob/

Creates a new cronjob and returns the new cronjob object.

Example request:

POST /api/v1.0/system/cronjob/ HTTP/1.1
Content-Type: application/json

  {
          "cron_user": "root",
          "cron_command": "/data/myscript.sh",
          "cron_minute": "*/20",
          "cron_hour": "*",
          "cron_daymonth": "*",
          "cron_month": "*",
          "cron_dayweek": "*",
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "cron_command": "/data/myscript.sh",
          "cron_daymonth": "*",
          "cron_dayweek": "*",
          "cron_description": "",
          "cron_enabled": true,
          "cron_hour": "*",
          "cron_minute": "*/20",
          "cron_month": "*",
          "cron_stderr": false,
          "cron_stdout": true,
          "cron_user": "root",
          "id": 2
  }
Json Parameters:
 
  • cron_command (string) – command to execute
  • cron_daymonth (string) – days of the month to run
  • cron_dayweek (string) – days of the week to run
  • cron_description (string) – description of the job
  • cron_enabled (boolean) – job enabled?
  • cron_hour (string) – hours to run
  • cron_minute (string) – minutes to run
  • cron_month (string) – months to run
  • cron_user (string) – user to run
  • cron_stderr (boolean) – redirect stderr to /dev/null
  • cron_stdout (boolean) – redirect stdout to /dev/null
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

PUT /api/v1.0/system/cronjob/(int: id)/

Update cronjob id.

Example request:

PUT /api/v1.0/system/cronjob/2/ HTTP/1.1
Content-Type: application/json

  {
          "cron_enabled": false,
          "cron_stderr": true
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "cron_command": "/data/myscript.sh",
          "cron_daymonth": "*",
          "cron_dayweek": "*",
          "cron_description": "",
          "cron_enabled": false,
          "cron_hour": "*",
          "cron_minute": "*/20",
          "cron_month": "*",
          "cron_stderr": true,
          "cron_stdout": true,
          "cron_user": "root",
          "id": 2
  }
Json Parameters:
 
  • cron_command (string) – command to execute
  • cron_daymonth (string) – days of the month to run
  • cron_dayweek (string) – days of the week to run
  • cron_description (string) – description of the job
  • cron_enabled (boolean) – job enabled?
  • cron_hour (string) – hours to run
  • cron_minute (string) – minutes to run
  • cron_month (string) – months to run
  • cron_user (string) – user to run
  • cron_stderr (boolean) – redirect stderr to /dev/null
  • cron_stdout (boolean) – redirect stdout to /dev/null
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/system/cronjob/(int: id)/

Delete cronjob id.

Example request:

DELETE /api/v1.0/system/cronjob/2/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error

InitShutdown

The InitShutdown resource represents Init and Shutdown scripts.

List resource

GET /api/v1.0/system/initshutdown/

Returns a list of all init shutdown scripts.

Example request:

GET /api/v1.0/system/initshutdown/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "id": 1
          "ini_type": "command",
          "ini_command": "rm /mnt/tank/temp*",
          "ini_when": "postinit"
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 30
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/system/initshutdown/

Creates a new initshutdown and returns the new initshutdown object.

Example request:

POST /api/v1.0/system/initshutdown/ HTTP/1.1
Content-Type: application/json

  {
          "ini_type": "command",
          "ini_command": "rm /mnt/tank/temp*",
          "ini_when": "postinit"
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "id": 1,
          "ini_command": "rm /mnt/tank/temp*",
          "ini_script": null,
          "ini_type": "command",
          "ini_when": "postinit"
  }
Json Parameters:
 
  • ini_command (string) – command to execute
  • ini_script (string) – path to script to execute
  • ini_type (string) – run a command (“command”) or a script (“script”)
  • ini_when (string) – preinit, postinit, shutdown
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

PUT /api/v1.0/system/initshutdown/(int: id)/

Update initshutdown id.

Example request:

PUT /api/v1.0/system/initshutdown/1/ HTTP/1.1
Content-Type: application/json

  {
          "ini_when": "preinit"
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "id": 1,
          "ini_command": "rm /mnt/tank/temp*",
          "ini_script": null,
          "ini_type": "command",
          "ini_when": "preinit"
  }
Json Parameters:
 
  • ini_command (string) – command to execute
  • ini_script (string) – path to script to execute
  • ini_type (string) – run a command (“command”) or a script (“script”)
  • ini_when (string) – preinit, postinit, shutdown
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/system/initshutdown/(int: id)/

Delete initshutdown id.

Example request:

DELETE /api/v1.0/system/initshutdown/1/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error

NTPServer

The NTPServer resource represents ntp.conf(5) to configure Network Time Protocol (NTP).

List resource

GET /api/v1.0/system/ntpserver/

Returns a list of all ntpservers.

Example request:

GET /api/v1.0/system/ntpserver/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "ntp_minpoll": 6,
          "ntp_maxpoll": 9,
          "ntp_prefer": false,
          "ntp_address": "0.freebsd.pool.ntp.org",
          "ntp_burst": false,
          "id": 1,
          "ntp_iburst": true
  },
  {
          "ntp_minpoll": 6,
          "ntp_maxpoll": 9,
          "ntp_prefer": false,
          "ntp_address": "1.freebsd.pool.ntp.org",
          "ntp_burst": false,
          "id": 2,
          "ntp_iburst": true
  },
  {
          "ntp_minpoll": 6,
          "ntp_maxpoll": 9,
          "ntp_prefer": false,
          "ntp_address": "2.freebsd.pool.ntp.org",
          "ntp_burst": false,
          "id": 3,
          "ntp_iburst": true
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 30
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/system/ntpserver/

Creates a new ntpserver and returns the new ntpserver object.

Example request:

POST /api/v1.0/system/ntpserver/ HTTP/1.1
Content-Type: application/json

  {
          "ntp_address": "br.pool.ntp.org"
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "ntp_minpoll": 6,
          "ntp_maxpoll": 10,
          "ntp_prefer": false,
          "ntp_address": "br.pool.ntp.org",
          "ntp_burst": false,
          "id": 4,
          "ntp_iburst": true
  }
Json Parameters:
 
  • ntp_minpoll (string) – minimum poll interval as a power of 2 in seconds
  • ntp_maxpoll (string) – maximum poll interval as a power of 2 in seconds
  • ntp_prefer (string) – mark this server as preferred
  • ntp_address (string) – address of the server
  • ntp_burst (string) – send a burst of 8 packets when reachable
  • ntp_iburst (string) – send a burst of 8 packets when unreachable
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

PUT /api/v1.0/system/ntpserver/(int: id)/

Update ntpserver id.

Example request:

PUT /api/v1.0/system/ntpserver/2/ HTTP/1.1
Content-Type: application/json

  {
          "ntp_prefer": true,
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "ntp_minpoll": 6,
          "ntp_maxpoll": 10,
          "ntp_prefer": true,
          "ntp_address": "br.pool.ntp.org",
          "ntp_burst": false,
          "id": 4,
          "ntp_iburst": true
  }
Json Parameters:
 
  • ntp_minpoll (string) – minimum poll interval as a power of 2 in seconds
  • ntp_maxpoll (string) – maximum poll interval as a power of 2 in seconds
  • ntp_prefer (string) – mark this server as preferred
  • ntp_address (string) – address of the server
  • ntp_burst (string) – send a burst of 8 packets when reachable
  • ntp_iburst (string) – send a burst of 8 packets when unreachable
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/system/ntpserver/(int: id)/

Delete ntpserver id.

Example request:

DELETE /api/v1.0/system/ntpserver/2/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error

Rsync

The Rsync resource represents rsync(1) to execute scheduled commands.

List resource

GET /api/v1.0/system/rsync/

Returns a list of all rsyncs.

Example request:

GET /api/v1.0/system/rsync/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "rsync_user": "root",
          "rsync_minute": "*/20",
          "rsync_enabled": true,
          "rsync_daymonth": "*",
          "rsync_path": "/mnt/tank",
          "rsync_delete": false,
          "rsync_hour": "*",
          "id": 1,
          "rsync_extra": "",
          "rsync_archive": false,
          "rsync_compress": true,
          "rsync_dayweek": "*",
          "rsync_desc": "",
          "rsync_direction": "push",
          "rsync_times": true,
          "rsync_preserveattr": false,
          "rsync_remotehost": "testhost",
          "rsync_mode": "module",
          "rsync_remotemodule": "testmodule",
          "rsync_remotepath": "",
          "rsync_quiet": false,
          "rsync_recursive": true,
          "rsync_month": "*",
          "rsync_preserveperm": false,
          "rsync_remoteport": 22
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 30
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/system/rsync/

Creates a new rsync and returns the new rsync object.

Example request:

POST /api/v1.0/system/rsync/ HTTP/1.1
Content-Type: application/json

  {
          "rsync_path": "/mnt/tank",
          "rsync_user": "root",
          "rsync_mode": "module",
          "rsync_remotemodule": "testmodule",
          "rsync_remotehost": "testhost",
          "rsync_direction": "push",
          "rsync_minute": "*/20",
          "rsync_hour": "*",
          "rsync_daymonth": "*",
          "rsync_month": "*",
          "rsync_dayweek": "*",
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "rsync_user": "root",
          "rsync_minute": "*/20",
          "rsync_enabled": true,
          "rsync_daymonth": "*",
          "rsync_path": "/mnt/tank",
          "rsync_delete": false,
          "rsync_hour": "*",
          "id": 1,
          "rsync_extra": "",
          "rsync_archive": false,
          "rsync_compress": true,
          "rsync_dayweek": "*",
          "rsync_desc": "",
          "rsync_direction": "push",
          "rsync_times": true,
          "rsync_preserveattr": false,
          "rsync_remotehost": "testhost",
          "rsync_mode": "module",
          "rsync_remotemodule": "testmodule",
          "rsync_remotepath": "",
          "rsync_quiet": false,
          "rsync_recursive": true,
          "rsync_month": "*",
          "rsync_preserveperm": false,
          "rsync_remoteport": 22
  }
Json Parameters:
 
  • rsync_path (string) – path to rsync
  • rsync_user (string) – user to run rsync(1)
  • rsync_mode (string) – module, ssh
  • rsync_remotemodule (string) – module of remote side
  • rsync_remotehost (string) – host of remote side
  • rsync_remoteport (string) – port of remote side
  • rsync_remotepath (string) – path of remote side
  • rsync_direction (string) – push, pull
  • rsync_minute (string) – minutes to run
  • rsync_hour (string) – hours to run
  • rsync_daymonth (string) – days of month to run
  • rsync_month (string) – months to run
  • rsync_dayweek (string) – days of week to run
  • rsync_archive (boolean) – archive mode
  • rsync_compress (boolean) – compress the stream
  • rsync_times (boolean) – preserve times
  • rsync_preserveattr (boolean) – preserve file attributes
  • rsync_quiet (boolean) – run quietly
  • rsync_recursive (boolean) – recursive
  • rsync_preserveperm (boolean) – preserve permissions
  • extra (string) – extra arguments to rsync(1)
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

PUT /api/v1.0/system/rsync/(int: id)/

Update rsync id.

Example request:

PUT /api/v1.0/system/rsync/1/ HTTP/1.1
Content-Type: application/json

  {
          "rsync_archive": true
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "rsync_user": "root",
          "rsync_minute": "*/20",
          "rsync_enabled": true,
          "rsync_daymonth": "*",
          "rsync_path": "/mnt/tank",
          "rsync_delete": false,
          "rsync_hour": "*",
          "id": 1,
          "rsync_extra": "",
          "rsync_archive": true,
          "rsync_compress": true,
          "rsync_dayweek": "*",
          "rsync_desc": "",
          "rsync_direction": "push",
          "rsync_times": true,
          "rsync_preserveattr": false,
          "rsync_remotehost": "testhost",
          "rsync_mode": "module",
          "rsync_remotemodule": "testmodule",
          "rsync_remotepath": "",
          "rsync_quiet": false,
          "rsync_recursive": true,
          "rsync_month": "*",
          "rsync_preserveperm": false,
          "rsync_remoteport": 22
  }
Json Parameters:
 
  • rsync_path (string) – path to rsync
  • rsync_user (string) – user to run rsync(1)
  • rsync_mode (string) – module, ssh
  • rsync_remotemodule (string) – module of remote side
  • rsync_remotehost (string) – host of remote side
  • rsync_remoteport (string) – port of remote side
  • rsync_remotepath (string) – path of remote side
  • rsync_direction (string) – push, pull
  • rsync_minute (string) – minutes to run
  • rsync_hour (string) – hours to run
  • rsync_daymonth (string) – days of month to run
  • rsync_month (string) – months to run
  • rsync_dayweek (string) – days of week to run
  • rsync_archive (boolean) – archive mode
  • rsync_compress (boolean) – compress the stream
  • rsync_times (boolean) – preserve times
  • rsync_preserveattr (boolean) – preserve file attributes
  • rsync_quiet (boolean) – run quietly
  • rsync_recursive (boolean) – recursive
  • rsync_preserveperm (boolean) – preserve permissions
  • extra (string) – extra arguments to rsync(1)
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/system/rsync/(int: id)/

Delete rsync id.

Example request:

DELETE /api/v1.0/system/rsync/1/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error

Settings

The Settings resource represents the system settings.

List resource

GET /api/v1.0/services/settings/

Returns the settings dictionary.

Example request:

GET /api/v1.0/services/settings/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "stg_timezone": "America/Los_Angeles",
          "stg_guiport": null,
          "stg_guihttpsport": null,
          "stg_guiprotocol": "http",
          "stg_guiv6address": "::",
          "stg_syslogserver": "",
          "stg_language": "en",
          "stg_directoryservice": "",
          "stg_guiaddress": "0.0.0.0",
          "stg_kbdmap": "",
          "id": 1
  }
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Update resource

PUT /api/v1.0/services/settings/

Update settings.

Example request:

PUT /api/v1.0/services/settings/ HTTP/1.1
Content-Type: application/json

  {
          "stg_timezone": "America/Sao_Paulo"
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "stg_timezone": "America/Sao_Paulo",
          "stg_guiport": null,
          "stg_guihttpsport": null,
          "stg_guiprotocol": "http",
          "stg_guiv6address": "::",
          "stg_syslogserver": "",
          "stg_language": "en",
          "stg_directoryservice": "",
          "stg_guiaddress": "0.0.0.0",
          "stg_kbdmap": "",
          "id": 1
  }
Json Parameters:
 
  • stg_guiprotocol (string) – http, https
  • stg_guiaddress (string) – WebGUI IPv4 Address
  • stg_guiv6address (string) – WebGUI IPv6 Address
  • stg_guiport (integer) – WebGUI Port for HTTP
  • stg_guihttpsport (integer) – WebGUI Port for HTTPS
  • stg_language (string) – webguil language
  • stg_kbdmap (string) – see /usr/share/syscons/keymaps/INDEX.keymaps
  • stg_timezone (string) – see /usr/share/zoneinfo
  • stg_syslogserver (string) – Syslog server
  • stg_directoryservice (string) – activedirectory, ldap, nt4, nis
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

SMARTTest

The SMARTTest resource represents schedule of SMART tests using smartd(8).

List resource

GET /api/v1.0/system/smarttest/

Returns a list of all smarttests.

Example request:

GET /api/v1.0/system/smarttest/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "smarttest_dayweek": "*",
          "smarttest_daymonth": "*",
          "smarttest_disks": [
                  2,
                  3
          ],
          "smarttest_month": "*",
          "smarttest_type": "L",
          "id": 1,
          "smarttest_hour": "*",
          "smarttest_desc": ""
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 30
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/system/smarttest/

Creates a new smarttest and returns the new smarttest object.

Example request:

POST /api/v1.0/system/smarttest/ HTTP/1.1
Content-Type: application/json

  {
          "smarttest_disks": [2, 3],
          "smarttest_type": "L",
          "smarttest_hour": "*",
          "smarttest_daymonth": "*",
          "smarttest_month": "*",
          "smarttest_dayweek": "*",
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "smarttest_dayweek": "*",
          "smarttest_daymonth": "*",
          "smarttest_disks": [
                  2,
                  3
          ],
          "smarttest_month": "*",
          "smarttest_type": "L",
          "id": 1,
          "smarttest_hour": "*",
          "smarttest_desc": ""
  }
Json Parameters:
 
  • smarttest_dayweek (string) – days of the week to run
  • smarttest_daymonth (string) – days of the month to run
  • smarttest_hour (string) – hours to run
  • smarttest_month (string) – months to run
  • smarttest_disks (string) – list of ids of “storage/disk” resource
  • smarttest_type (string) – L (Long Self-Test), S (Short Self-Test), C (Conveyance Self-Test (ATA only)), O (Offline Immediate Test (ATA only))
  • smarttest_desc (string) – user description of the test
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

PUT /api/v1.0/system/smarttest/(int: id)/

Update smarttest id.

Example request:

PUT /api/v1.0/system/smarttest/1/ HTTP/1.1
Content-Type: application/json

  {
          "smarttest_type": "S",
          "smarttest_disks": [2, 3]
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "smarttest_dayweek": "*",
          "smarttest_daymonth": "*",
          "smarttest_disks": [
                  2,
                  3
          ],
          "smarttest_month": "*",
          "smarttest_type": "L",
          "id": 1,
          "smarttest_hour": "*",
          "smarttest_desc": ""
  }
Json Parameters:
 
  • smarttest_dayweek (string) – days of the week to run
  • smarttest_daymonth (string) – days of the month to run
  • smarttest_hour (string) – hours to run
  • smarttest_month (string) – months to run
  • smarttest_disks (string) – list of ids of “storage/disk” resource
  • smarttest_type (string) – L (Long Self-Test), S (Short Self-Test), C (Conveyance Self-Test (ATA only)), O (Offline Immediate Test (ATA only))
  • smarttest_desc (string) – user description of the test
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/system/smarttest/(int: id)/

Delete smarttest id.

Example request:

DELETE /api/v1.0/system/smarttest/1/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error

Sysctl

The Sysctl resource represents sysctl(8), get or set kernel state.

List resource

GET /api/v1.0/system/sysctl/

Returns a list of all sysctls.

Example request:

GET /api/v1.0/system/sysctl/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "sysctl_mib": "net.inet.tcp.rfc1323",
          "sysctl_comment": "",
          "sysctl_value": "0",
          "sysctl_enabled": true
          "id": 1,
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 30
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/system/sysctl/

Creates a new sysctl and returns the new sysctl object.

Example request:

POST /api/v1.0/system/sysctl/ HTTP/1.1
Content-Type: application/json

  {
          "sysctl_mib": "net.inet.tcp.rfc1323",
          "sysctl_value": "0",
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "sysctl_mib": "net.inet.tcp.rfc1323",
          "sysctl_comment": "",
          "sysctl_value": "0",
          "sysctl_enabled": true
          "id": 1,
  }
Json Parameters:
 
  • sysctl_mib (string) – name of the sysctl
  • sysctl_value (string) – value of the sysctl
  • sysctl_comment (string) – user comment for the entry
  • sysctl_enabled (boolean) – whether the entry is enabled
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

PUT /api/v1.0/system/sysctl/(int: id)/

Update sysctl id.

Example request:

PUT /api/v1.0/system/sysctl/1/ HTTP/1.1
Content-Type: application/json

  {
          "sysctl_value": "1",
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "sysctl_mib": "net.inet.tcp.rfc1323",
          "sysctl_comment": "",
          "sysctl_value": "1",
          "sysctl_enabled": true
          "id": 1,
  }
Json Parameters:
 
  • sysctl_mib (string) – name of the sysctl
  • sysctl_value (string) – value of the sysctl
  • sysctl_comment (string) – user comment for the entry
  • sysctl_enabled (boolean) – whether the entry is enabled
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/system/sysctl/(int: id)/

Delete sysctl id.

Example request:

DELETE /api/v1.0/system/sysctl/1/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error

Tunable

The Tunable resource represents loader.conf(5).

List resource

GET /api/v1.0/system/tunable/

Returns a list of all tunables.

Example request:

GET /api/v1.0/system/tunable/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "tun_var": "xhci_load",
          "tun_comment": "",
          "tun_value": "YES",
          "tun_enabled": true
          "id": 1,
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 30
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/system/tunable/

Creates a new tunable and returns the new tunable object.

Example request:

POST /api/v1.0/system/tunable/ HTTP/1.1
Content-Type: application/json

  {
          "tun_var": "xhci_load",
          "tun_value": "YES",
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "tun_var": "xhci_load",
          "tun_comment": "",
          "tun_value": "YES",
          "tun_enabled": true
          "id": 1,
  }
Json Parameters:
 
  • tun_var (string) – name of the tunable
  • tun_value (string) – value of the tunable
  • tun_comment (string) – user comment for the entry
  • tun_enabled (boolean) – whether the entry is enabled
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

PUT /api/v1.0/system/tunable/(int: id)/

Update tunable id.

Example request:

PUT /api/v1.0/system/tunable/1/ HTTP/1.1
Content-Type: application/json

  {
          "tun_enabled": false
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "tun_var": "xhci_load",
          "tun_comment": "",
          "tun_value": "YES",
          "tun_enabled": false
          "id": 1,
  }
Json Parameters:
 
  • tun_var (string) – name of the tunable
  • tun_value (string) – value of the tunable
  • tun_comment (string) – user comment for the entry
  • tun_enabled (boolean) – whether the entry is enabled
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/system/tunable/(int: id)/

Delete tunable id.

Example request:

DELETE /api/v1.0/system/tunable/1/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error