Commit Graph

51 Commits

Author SHA1 Message Date
Brandon Schneider
a5f05b7162 Added starting iocage jail API call
Websocket is duplicated after REST call, so it actually shows the jail as up since the REST request has already run

REST Request:
-------------------------------
PUT /sysadm/iocage
{
   "action" : "startjail",
   "jail" : "test"
}

REST Response:
-------------------------------
{
    "args": {
        "startjail": {
            "test": {
                "* Starting 0bf985de-ca0f-11e5-8d45-d05099728dbf (test)": "",
                "+ Started (shared IP mode) OK": "",
                "+ Starting services OK": ""
            }
        }
    }
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "id" : "fooid",
   "args" : {
      "action" : "startjail",
      "jail" : "test"
   },
   "name" : "iocage"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "startjail": {
      "test": {
        "INFO": " 0bf985de-ca0f-11e5-8d45-d05099728dbf (test) is already up"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-03 17:14:09 -06:00
Kris Moore
f4a61e7d0a Add new API call to set a sysctl
REST Request:
-------------------------------
PUT /sysadm/systemmanager
{
   "value" : "0",
   "sysctl" : "security.jail.mount_devfs_allowed",
   "action" : "setsysctl"
}

REST Response:
-------------------------------
{
    "args": {
        "setsysctl": {
            "response": "security.jail.mount_devfs_allowed: 1 -> 0",
            "sysctl": "security.jail.mount_devfs_allowed",
            "value": "0"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "value" : "0",
      "action" : "setsysctl",
      "sysctl" : "security.jail.mount_devfs_allowed"
   },
   "name" : "systemmanager",
   "namespace" : "sysadm",
   "id" : "fooid"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "setsysctl": {
      "response": "security.jail.mount_devfs_allowed: 1 -> 0",
      "sysctl": "security.jail.mount_devfs_allowed",
      "value": "0"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-03 13:21:00 -05:00
Kris Moore
fccac94ab6 Add new API call "sysctllist"
Returns the list of all setable sysctl values

REST Request:
-------------------------------
PUT /sysadm/systemmanager
{
   "action" : "sysctllist"
}

REST Response:
-------------------------------
{
    "args": {
        "sysctllist": {
            "compat.ia32.maxdsiz": "536870912",
            "compat.ia32.maxssiz": "67108864",
            "compat.ia32.maxvmem": "0",
            "compat.linux.osname": "Linux",
            "compat.linux.osrelease": "2.6.18",
            "compat.linux.oss_version": "198144",
            "compat.linux32.maxdsiz": "536870912",
            "compat.linux32.maxssiz": "67108864",
            "compat.linux32.maxvmem": "0",
            ....
        }
    }
}

WebSocket Request:
-------------------------------
{
   "name" : "systemmanager",
   "namespace" : "sysadm",
   "id" : "fooid",
   "args" : {
      "action" : "sysctllist"
   }
}

WebSocket Response:
-------------------------------
{
  "args": {
    "sysctllist": {
      "compat.ia32.maxdsiz": "536870912",
      "compat.ia32.maxssiz": "67108864",
      "compat.ia32.maxvmem": "0",
      "compat.linux.osname": "Linux",
      "compat.linux.osrelease": "2.6.18",
      "compat.linux.oss_version": "198144",
      "compat.linux32.maxdsiz": "536870912",
      "compat.linux32.maxssiz": "67108864",
      "compat.linux32.maxvmem": "0",
      ....
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-03 13:09:31 -05:00
Kris Moore
36d2f77d5c Add API call to kill processes on the system
pid = <pid>
signal = {INT|QUIT|ABRT|KILL|ALRM|TERM}

REST Request:
-------------------------------
PUT /sysadm/systemmanager
{
   "signal" : "KILL",
   "pid" : "13939",
   "action" : "killproc"
}

REST Response:
-------------------------------
{
    "args": {
        "killproc": {
            "action": "killproc",
            "pid": "13939",
            "signal": "KILL"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "args" : {
      "pid" : "13939",
      "action" : "killproc",
      "signal" : "KILL"
   },
   "id" : "fooid",
   "name" : "systemmanager"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "killproc": {
      "action": "killproc",
      "pid": "13939",
      "signal": "KILL"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-03 12:45:02 -05:00
Kris Moore
6fd9a689b4 Rename "systeminfo" class -> "systemmanager"
Updated the docs as part of this commit
2016-02-03 12:27:06 -05:00
Ken Moore
8166ef8a79 Cleanup a lot of the logging in the sysadm server. Now the hostinfo log file will clearly list connection time/IP, auth attempts/IP, Dispatches/IP, disconnections/IP. The dispatcher and events systems also properly log activity within their individual log files. 2016-02-02 13:46:23 -05:00
Kris Moore
c9e4b2479a Add a new API call to "systeminfo" class, which returns
information about all processes on the system.

The below example was greatly truncated ;)

REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
   "action" : "procinfo"
}

REST Response:
-------------------------------
{
    "args": {
        "procinfo": {
                  "228": {
        "command": "adjkerntz",
        "cpu": "3",
        "nice": "0",
        "pri": "52",
        "res": "1968K",
        "size": "8276K",
        "state": "pause",
        "thr": "1",
        "time": "0:00",
        "username": "root",
        "wcpu": "0.00%"
          }
        }
    }
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "namespace" : "sysadm",
   "name" : "systeminfo",
   "args" : {
      "action" : "procinfo"
   }
}

WebSocket Response:
-------------------------------
{
  "args": {
    "procinfo": {
      "228": {
        "command": "adjkerntz",
        "cpu": "3",
        "nice": "0",
        "pri": "52",
        "res": "1968K",
        "size": "8276K",
        "state": "pause",
        "thr": "1",
        "time": "0:00",
        "username": "root",
        "wcpu": "0.00%"
      }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-02 11:06:45 -05:00
Kris Moore
bd53bbc29b Add new API class for 'iohyve' along with the initial 'listvms'
API call

REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "action" : "listvms"
}

REST Response:
-------------------------------
{
    "args": {
        "listvms": {
            "testguest": {
                "description": "February 1, 2016 at 03:11:57 PM EST",
                "rcboot": "NO",
                "running": "NO",
                "vmm": "YES"
            }
        }
    }
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "args" : {
      "action" : "listvms"
   },
   "name" : "iohyve",
   "id" : "fooid"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "listvms": {
      "testguest": {
        "description": "February 1, 2016 at 03:11:57 PM EST",
        "rcboot": "NO",
        "running": "NO",
        "vmm": "YES"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-01 15:23:21 -05:00
Ken Moore
87c545230c New API: Change the sysadm dispatcher access to use the built-in dispatcher system now instead of the old shell script. This new API will have the server queue up generic processes/commands as the user needs (main output will return through the event system). The example blow included a single command queue (procID1), as well an an example of chaining a couple commands together as a single process call (procID2).
REST Request:
-------------------------------
PUT /rpc/dispatcher
{
   "action" : "run",
   "procID2" : [
      "echo chainCmd1",
      "echo chainCmd2"
   ],
   "procID1" : "echo sample1"
}

REST Response:
-------------------------------
{
    "args": {
        "started": [
            "procID1",
            "procID2"
        ]
    }
}

WebSocket Request:
-------------------------------
{
   "name" : "dispatcher",
   "namespace" : "rpc",
   "id" : "fooid",
   "args" : {
      "procID1" : "echo sample1",
      "procID2" : [
         "echo chainCmd1",
         "echo chainCmd2"
      ],
      "action" : "run"
   }
}

WebSocket Response:
-------------------------------
{
  "args": {
    "started": [
      "procID1",
      "procID2"
    ]
  },
  "id": "fooid",
  "name": "response",
  "namespace": "rpc"
}
2016-02-01 14:19:25 -05:00
Ken Moore
1146b14917 Cleanup the library/server interactions for sysadm: Now the "library" directory is just an internal collection of classes/files, rather than an actual library of system calls. This allows for in-server globals usage (such as the dispatcher/events systems) within the library files as needed. 2016-02-01 12:29:25 -05:00
Ken Moore
a95404c88d Merge branch 'master' of github.com:pcbsd/sysadm 2016-02-01 11:21:04 -05:00
Ken Moore
df94531644 Setup the subsystem access to automatically deny access to systems which are not currently available (read/write access needs to be managed by the individual subsystems) 2016-02-01 11:18:24 -05:00
Ken Moore
1e9ec2d4b6 Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-01-29 16:27:48 -05:00
Ken Moore
04c366f114 Finish adding in the new dispatcher system (untested). This should be ready for trying out in some subsystem now.
Note: to queue up a job you just need to run one of the DISPATCHER->queue() functions (there are a few overloaded versions for simplicity)
2016-01-29 16:24:40 -05:00
Kris Moore
5a53aacf9f Add new API call to get all iocage default settings
REST Request:
-------------------------------
PUT /sysadm/iocage
{
   "action" : "getdefaultsettings"
}

REST Response:
-------------------------------
{
    "args": {
        "getdefaultsettings": {
            "defaults": {
                "allow_chflags": "0",
                "allow_mount": "0",
                "allow_mount_devfs": "0",
                "allow_mount_nullfs": "0",
                "allow_mount_procfs": "0",
                "allow_mount_tmpfs": "0",
                "allow_mount_zfs": "0",
                "allow_quotas": "0",
                "allow_raw_sockets": "0",
                "allow_set_hostname": "1",
                "allow_socket_af": "0",
                "allow_sysvipc": "0",
                "available": "426G",
                "boot": "off",
                "bpf": "off",
                "children_max": "0",
                "compression": "lz4",
                "compressratio": "1.00x",
                "coredumpsize": "off",
                "count": "1",
                "cpuset": "off",
                "cputime": "off",
                "datasize": "off",
                "dedup": "off",
                "defaultrouter": "none",
                "defaultrouter6": "none",
                "devfs_ruleset": "4",
                "dhcp": "off",
                "enforce_statfs": "2",
                "exec_clean": "1",
                "exec_fib": "0",
                "exec_jail_user": "root",
                "exec_poststart": "/usr/bin/true",
                "exec_poststop": "/usr/bin/true",
                "exec_prestart": "/usr/bin/true",
                "exec_prestop": "/usr/bin/true",
                "exec_start": "/bin/sh /etc/rc",
                "exec_stop": "/bin/sh /etc/rc.shutdown",
                "exec_system_jail_user": "0",
                "exec_system_user": "root",
                "exec_timeout": "60",
                "ftpfiles": "base.txz doc.txz lib32.txz src.txz",
                "ftphost": "ftp.freebsd.org",
                "gitlocation": "https://github.com",
                "hack88": "0",
                "host_domainname": "none",
                "host_hostname": "442a5843-c6bd-11e5-bbe9-fcaa14deb15d",
                "host_hostuuid": "442a5843-c6bd-11e5-bbe9-fcaa14deb15d",
                "hostid": "4145fbb8-c5b6-11e5-9f2f-fcaa14deb15d",
                "interfaces": "vnet0:bridge0,vnet1:bridge1",
                "ip4": "new",
                "ip4_addr": "none",
                "ip4_autoend": "none",
                "ip4_autostart": "none",
                "ip4_autosubnet": "none",
                "ip4_saddrsel": "1",
                "ip6": "new",
                "ip6_addr": "none",
                "ip6_saddrsel": "1",
                "istemplate": "no",
                "jail_zfs": "off",
                "jail_zfs_dataset": "iocage/jails/442a5843-c6bd-11e5-bbe9-fcaa14deb15d/data",
                "jail_zfs_mountpoint": "none",
                "last_started": "none",
                "login_flags": "-f root",
                "maxproc": "off",
                "memorylocked": "off",
                "memoryuse": "8G:log",
                "mount_devfs": "1",
                "mount_fdescfs": "1",
                "mount_linprocfs": "0",
                "mount_procfs": "0",
                "mountpoint": "/iocage/.defaults",
                "msgqqueued": "off",
                "msgqsize": "off",
                "nmsgq": "off",
                "notes": "none",
                "nsemop": "off",
                "nshm": "off",
                "nthr": "off",
                "openfiles": "off",
                "origin": "-",
                "owner": "root",
                "pcpu": "off",
                "pkglist": "none",
                "priority": "99",
                "pseudoterminals": "off",
                "quota": "none",
                "release": "11.0-CURRENTJAN2016",
                "reservation": "none",
                "resolver": "none",
                "rlimits": "off",
                "securelevel": "2",
                "shmsize": "off",
                "stacksize": "off",
                "stop_timeout": "30",
                "swapuse": "off",
                "sync_target": "none",
                "sync_tgt_zpool": "none",
                "tag": "2016-01-29@14:19:49",
                "type": "basejail",
                "used": "96K",
                "vmemoryuse": "off",
                "vnet": "off",
                "vnet0_mac": "none",
                "vnet1_mac": "none",
                "vnet2_mac": "none",
                "vnet3_mac": "none",
                "wallclock": "off"
            }
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "getdefaultsettings"
   },
   "id" : "fooid",
   "name" : "iocage",
   "namespace" : "sysadm"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "getdefaultsettings": {
      "defaults": {
        "allow_chflags": "0",
        "allow_mount": "0",
        "allow_mount_devfs": "0",
        "allow_mount_nullfs": "0",
        "allow_mount_procfs": "0",
        "allow_mount_tmpfs": "0",
        "allow_mount_zfs": "0",
        "allow_quotas": "0",
        "allow_raw_sockets": "0",
        "allow_set_hostname": "1",
        "allow_socket_af": "0",
        "allow_sysvipc": "0",
        "available": "426G",
        "boot": "off",
        "bpf": "off",
        "children_max": "0",
        "compression": "lz4",
        "compressratio": "1.00x",
        "coredumpsize": "off",
        "count": "1",
        "cpuset": "off",
        "cputime": "off",
        "datasize": "off",
        "dedup": "off",
        "defaultrouter": "none",
        "defaultrouter6": "none",
        "devfs_ruleset": "4",
        "dhcp": "off",
        "enforce_statfs": "2",
        "exec_clean": "1",
        "exec_fib": "0",
        "exec_jail_user": "root",
        "exec_poststart": "/usr/bin/true",
        "exec_poststop": "/usr/bin/true",
        "exec_prestart": "/usr/bin/true",
        "exec_prestop": "/usr/bin/true",
        "exec_start": "/bin/sh /etc/rc",
        "exec_stop": "/bin/sh /etc/rc.shutdown",
        "exec_system_jail_user": "0",
        "exec_system_user": "root",
        "exec_timeout": "60",
        "ftpfiles": "base.txz doc.txz lib32.txz src.txz",
        "ftphost": "ftp.freebsd.org",
        "gitlocation": "https://github.com",
        "hack88": "0",
        "host_domainname": "none",
        "host_hostname": "442a5843-c6bd-11e5-bbe9-fcaa14deb15d",
        "host_hostuuid": "442a5843-c6bd-11e5-bbe9-fcaa14deb15d",
        "hostid": "4145fbb8-c5b6-11e5-9f2f-fcaa14deb15d",
        "interfaces": "vnet0:bridge0,vnet1:bridge1",
        "ip4": "new",
        "ip4_addr": "none",
        "ip4_autoend": "none",
        "ip4_autostart": "none",
        "ip4_autosubnet": "none",
        "ip4_saddrsel": "1",
        "ip6": "new",
        "ip6_addr": "none",
        "ip6_saddrsel": "1",
        "istemplate": "no",
        "jail_zfs": "off",
        "jail_zfs_dataset": "iocage/jails/442a5843-c6bd-11e5-bbe9-fcaa14deb15d/data",
        "jail_zfs_mountpoint": "none",
        "last_started": "none",
        "login_flags": "-f root",
        "maxproc": "off",
        "memorylocked": "off",
        "memoryuse": "8G:log",
        "mount_devfs": "1",
        "mount_fdescfs": "1",
        "mount_linprocfs": "0",
        "mount_procfs": "0",
        "mountpoint": "/iocage/.defaults",
        "msgqqueued": "off",
        "msgqsize": "off",
        "nmsgq": "off",
        "notes": "none",
        "nsemop": "off",
        "nshm": "off",
        "nthr": "off",
        "openfiles": "off",
        "origin": "-",
        "owner": "root",
        "pcpu": "off",
        "pkglist": "none",
        "priority": "99",
        "pseudoterminals": "off",
        "quota": "none",
        "release": "11.0-CURRENTJAN2016",
        "reservation": "none",
        "resolver": "none",
        "rlimits": "off",
        "securelevel": "2",
        "shmsize": "off",
        "stacksize": "off",
        "stop_timeout": "30",
        "swapuse": "off",
        "sync_target": "none",
        "sync_tgt_zpool": "none",
        "tag": "2016-01-29@14:19:49",
        "type": "basejail",
        "used": "96K",
        "vmemoryuse": "off",
        "vnet": "off",
        "vnet0_mac": "none",
        "vnet1_mac": "none",
        "vnet2_mac": "none",
        "vnet3_mac": "none",
        "wallclock": "off"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-29 15:37:43 -05:00
Kris Moore
188f20ff16 Add new 'getjailsettings' API call which returns all the
'iocage get all <jail>' properties in json

REST Request:
-------------------------------
PUT /sysadm/iocage
{
   "jail" : "testjail",
   "action" : "getjailsettings"
}

REST Response:
-------------------------------
{
    "args": {
        "getjailsettings": {
            "testjail": {
                "allow_chflags": "0",
                "allow_mount": "0",
                "allow_mount_devfs": "0",
                "allow_mount_nullfs": "0",
                "allow_mount_procfs": "0",
                "allow_mount_tmpfs": "0",
                "allow_mount_zfs": "0",
                "allow_quotas": "0",
                "allow_raw_sockets": "0",
                "allow_set_hostname": "1",
                "allow_socket_af": "0",
                "allow_sysvipc": "0",
                "boot": "off",
                "bpf": "off",
                "branch": "-",
                "children_max": "0",
                "coredumpsize": "off",
                "count": "1",
                "cpuset": "off",
                "cputime": "off",
                "datasize": "off",
                "defaultrouter": "none",
                "defaultrouter6": "none",
                "devfs_ruleset": "4",
                "dhcp": "off",
                "enforce_statfs": "2",
                "exec_clean": "1",
                "exec_fib": "0",
                "exec_jail_user": "root",
                "exec_poststart": "/usr/bin/true",
                "exec_poststop": "/usr/bin/true",
                "exec_prestart": "/usr/bin/true",
                "exec_prestop": "/usr/bin/true",
                "exec_start": "/bin/sh /etc/rc",
                "exec_stop": "/bin/sh /etc/rc.shutdown",
                "exec_system_jail_user": "0",
                "exec_system_user": "root",
                "exec_timeout": "60",
                "ftpdir": "-",
                "ftpfiles": "-",
                "ftphost": "-",
                "ftplocaldir": "-",
                "gitlocation": "https",
                "hack88": "0",
                "host_domainname": "none",
                "host_hostname": "4bb3f929-c6bf-11e5-bbe9-fcaa14deb15d",
                "host_hostuuid": "4bb3f929-c6bf-11e5-bbe9-fcaa14deb15d",
                "hostid": "4145fbb8-c5b6-11e5-9f2f-fcaa14deb15d",
                "interfaces": "vnet0",
                "ip4": "new",
                "ip4_addr": "none",
                "ip4_autoend": "none",
                "ip4_autostart": "none",
                "ip4_autosubnet": "none",
                "ip4_saddrsel": "1",
                "ip6": "new",
                "ip6_addr": "none",
                "ip6_saddrsel": "1",
                "istemplate": "no",
                "jail_zfs": "off",
                "jail_zfs_dataset": "iocage/jails/4ba5d76b-c6bf-11e5-bbe9-fcaa14deb15d/data",
                "jail_zfs_mountpoint": "none",
                "last_started": "none",
                "login_flags": "-f root",
                "maxproc": "off",
                "memorylocked": "off",
                "memoryuse": "8G",
                "mount_devfs": "1",
                "mount_fdescfs": "1",
                "mount_linprocfs": "0",
                "mount_procfs": "0",
                "msgqqueued": "off",
                "msgqsize": "off",
                "nmsgq": "off",
                "notes": "none",
                "nsemop": "off",
                "nshm": "off",
                "nthr": "off",
                "openfiles": "off",
                "owner": "root",
                "pcpu": "off",
                "pkglist": "none",
                "priority": "99",
                "pseudoterminals": "off",
                "release": "10.2-RELEASE",
                "resolver": "none",
                "rlimits": "off",
                "securelevel": "2",
                "shmsize": "off",
                "stacksize": "off",
                "start": "-",
                "stop_timeout": "30",
                "swapuse": "off",
                "sync_stat": "-",
                "sync_target": "none",
                "sync_tgt_zpool": "none",
                "tag": "testjail",
                "template": "-",
                "type": "basejail",
                "vmemoryuse": "off",
                "vnet": "off",
                "vnet0_mac": "none",
                "vnet1_mac": "none",
                "vnet2_mac": "none",
                "vnet3_mac": "none",
                "wallclock": "off"
            }
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "jail" : "testjail",
      "action" : "getjailsettings"
   },
   "id" : "fooid",
   "name" : "iocage",
   "namespace" : "sysadm"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "getjailsettings": {
      "testjail": {
        "allow_chflags": "0",
        "allow_mount": "0",
        "allow_mount_devfs": "0",
        "allow_mount_nullfs": "0",
        "allow_mount_procfs": "0",
        "allow_mount_tmpfs": "0",
        "allow_mount_zfs": "0",
        "allow_quotas": "0",
        "allow_raw_sockets": "0",
        "allow_set_hostname": "1",
        "allow_socket_af": "0",
        "allow_sysvipc": "0",
        "boot": "off",
        "bpf": "off",
        "branch": "-",
        "children_max": "0",
        "coredumpsize": "off",
        "count": "1",
        "cpuset": "off",
        "cputime": "off",
        "datasize": "off",
        "defaultrouter": "none",
        "defaultrouter6": "none",
        "devfs_ruleset": "4",
        "dhcp": "off",
        "enforce_statfs": "2",
        "exec_clean": "1",
        "exec_fib": "0",
        "exec_jail_user": "root",
        "exec_poststart": "/usr/bin/true",
        "exec_poststop": "/usr/bin/true",
        "exec_prestart": "/usr/bin/true",
        "exec_prestop": "/usr/bin/true",
        "exec_start": "/bin/sh /etc/rc",
        "exec_stop": "/bin/sh /etc/rc.shutdown",
        "exec_system_jail_user": "0",
        "exec_system_user": "root",
        "exec_timeout": "60",
        "ftpdir": "-",
        "ftpfiles": "-",
        "ftphost": "-",
        "ftplocaldir": "-",
        "gitlocation": "https",
        "hack88": "0",
        "host_domainname": "none",
        "host_hostname": "4bb3f929-c6bf-11e5-bbe9-fcaa14deb15d",
        "host_hostuuid": "4bb3f929-c6bf-11e5-bbe9-fcaa14deb15d",
        "hostid": "4145fbb8-c5b6-11e5-9f2f-fcaa14deb15d",
        "interfaces": "vnet0",
        "ip4": "new",
        "ip4_addr": "none",
        "ip4_autoend": "none",
        "ip4_autostart": "none",
        "ip4_autosubnet": "none",
        "ip4_saddrsel": "1",
        "ip6": "new",
        "ip6_addr": "none",
        "ip6_saddrsel": "1",
        "istemplate": "no",
        "jail_zfs": "off",
        "jail_zfs_dataset": "iocage/jails/4ba5d76b-c6bf-11e5-bbe9-fcaa14deb15d/data",
        "jail_zfs_mountpoint": "none",
        "last_started": "none",
        "login_flags": "-f root",
        "maxproc": "off",
        "memorylocked": "off",
        "memoryuse": "8G",
        "mount_devfs": "1",
        "mount_fdescfs": "1",
        "mount_linprocfs": "0",
        "mount_procfs": "0",
        "msgqqueued": "off",
        "msgqsize": "off",
        "nmsgq": "off",
        "notes": "none",
        "nsemop": "off",
        "nshm": "off",
        "nthr": "off",
        "openfiles": "off",
        "owner": "root",
        "pcpu": "off",
        "pkglist": "none",
        "priority": "99",
        "pseudoterminals": "off",
        "release": "10.2-RELEASE",
        "resolver": "none",
        "rlimits": "off",
        "securelevel": "2",
        "shmsize": "off",
        "stacksize": "off",
        "start": "-",
        "stop_timeout": "30",
        "swapuse": "off",
        "sync_stat": "-",
        "sync_target": "none",
        "sync_tgt_zpool": "none",
        "tag": "testjail",
        "template": "-",
        "type": "basejail",
        "vmemoryuse": "off",
        "vnet": "off",
        "vnet0_mac": "none",
        "vnet1_mac": "none",
        "vnet2_mac": "none",
        "vnet3_mac": "none",
        "wallclock": "off"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-29 14:45:37 -05:00
Kris Moore
478bdb204c Add the first iocage sysadm API call
REST Request:
-------------------------------
PUT /sysadm/iocage
{
   "action" : "listjails"
}

REST Response:
-------------------------------
{
    "args": {
        "listjails": {
            "611c89ae-c43c-11e5-9602-54ee75595566": {
                "boot": "off",
                "jid": "-",
                "state": "down",
                "tag": "testjail",
                "type": "basejail"
            }
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "listjails"
   },
   "name" : "iocage",
   "id" : "fooid",
   "namespace" : "sysadm"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "listjails": {
      "611c89ae-c43c-11e5-9602-54ee75595566": {
        "boot": "off",
        "jid": "-",
        "state": "down",
        "tag": "testjail",
        "type": "basejail"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-26 10:11:14 -05:00
Kris Moore
56a3fb21b1 Add systeminfo / update / iocage to subsystems we test for 2016-01-26 09:37:28 -05:00
Kris Moore
ccd41322bd Replace the 'memorypercentage' API call with 'memorystats', which returns
much more meaningfull information to let us do graphs and whatnot

REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
   "action" : "memorystats"
}

REST Response:
-------------------------------
{
    "args": {
        "memorystats": {
            "active": "818",
            "cache": "69",
            "free": "4855",
            "inactive": "2504",
            "wired": "1598"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "memorystats"
   },
   "namespace" : "sysadm",
   "id" : "fooid",
   "name" : "systeminfo"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "memorystats": {
      "active": "826",
      "cache": "69",
      "free": "4847",
      "inactive": "2505",
      "wired": "1598"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-25 15:51:43 -05:00
Kris Moore
d873746bfe Add new API call to get a bunch of various system information back
REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
   "action" : "systeminfo"
}

REST Response:
-------------------------------
{
    "args": {
        "systeminfo": {
            "arch": "amd64",
            "cpucores": "4",
            "cputype": "Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz",
            "hostname": "krisdesktop",
            "kernelident": "GENERIC",
            "kernelversion": "10.2-RELEASE-p11",
            "systemversion": "10.2-RELEASE-p12",
            "totalmem": 10720,
            "uptime": "up 2 days 5:09"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "systeminfo"
   },
   "id" : "fooid",
   "name" : "systeminfo",
   "namespace" : "sysadm"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "systeminfo": {
      "arch": "amd64",
      "cpucores": "4",
      "cputype": "Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz",
      "hostname": "krisdesktop",
      "kernelident": "GENERIC",
      "kernelversion": "10.2-RELEASE-p11",
      "systemversion": "10.2-RELEASE-p12",
      "totalmem": 10720,
      "uptime": "up 2 days 5:09"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-25 14:55:41 -05:00
Kris Moore
98087f0faa Add new API call for listing available branches to update to
REST Request:
-------------------------------
PUT /sysadm/update
{
   "action" : "listbranches"
}

REST Response:
-------------------------------
{
    "args": {
        "listbranches": {
            "10.1-RELEASE": "available",
            "10.2-RELEASE": "active",
            "11.0-CURRENTJAN2016": "available"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "listbranches"
   },
   "namespace" : "sysadm",
   "name" : "update",
   "id" : "fooid"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "listbranches": {
      "10.1-RELEASE": "available",
      "10.2-RELEASE": "active",
      "11.0-CURRENTJAN2016": "available"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-25 14:21:37 -05:00
Kris Moore
1fc7b3cabd Add a new API call which returns the total memory in use
This will be expanded upon later so we can return more of the
particulars of where memory is used

REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
   "action" : "memorypercentage"
}

REST Response:
-------------------------------
{
    "args": {
        "memorypercentage": {
            "memoryused": 42
        }
    }
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "args" : {
      "action" : "memorypercentage"
   },
   "namespace" : "sysadm",
   "name" : "systeminfo"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "memorypercentage": {
      "memoryused": 42
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-21 13:47:11 -05:00
Kris Moore
aa5755d4b4 New API call to get cpupercentage stats
REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
   "action" : "cpupercentage"
}

REST Response:
-------------------------------
{
    "args": {
        "cpupercentage": {
            "busytotal": "28",
            "cpu1": {
                "busy": "28"
            },
            "cpu2": {
                "busy": "31"
            },
            "cpu3": {
                "busy": "29"
            },
            "cpu4": {
                "busy": "24"
            }
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "cpupercentage"
   },
   "name" : "systeminfo",
   "id" : "fooid",
   "namespace" : "sysadm"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "cpupercentage": {
      "busytotal": "28",
      "cpu1": {
        "busy": "28"
      },
      "cpu2": {
        "busy": "31"
      },
      "cpu3": {
        "busy": "29"
      },
      "cpu4": {
        "busy": "24"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-21 13:39:22 -05:00
Kris Moore
609bba2ded New API call to get a listing of all the CPU temps on the system,
if the "coretemp" module isn't loaded, it will be loaded beforehand

REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
   "action" : "cputemps"
}

REST Response:
-------------------------------
{
    "args": {
        "cputemps": {
            "cpu0": "27.0C",
            "cpu1": "34.0C",
            "cpu2": "33.0C",
            "cpu3": "31.0C"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "cputemps"
   },
   "id" : "fooid",
   "name" : "systeminfo",
   "namespace" : "sysadm"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "cputemps": {
      "cpu0": "34.0C",
      "cpu1": "32.0C",
      "cpu2": "34.0C",
      "cpu3": "31.0C"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-21 12:58:12 -05:00
Kris Moore
58e7e7a4e3 Add new API call for batteryinfo
Will return battery:"true/false" if one exists

If one exists, it will also return "level":"1-99"
and "status":"offline/charging/backup/unknown"

REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
   "action" : "batteryinfo"
}

REST Response:
-------------------------------
{
    "args": {
        "batteryinfo": {
            "battery": "false"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "name" : "systeminfo",
   "id" : "fooid",
   "args" : {
      "action" : "batteryinfo"
   }
}

WebSocket Response:
-------------------------------
{
  "args": {
    "batteryinfo": {
      "battery": "false"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-20 13:26:38 -05:00
Kris Moore
7d839787bd Add first API call for the "systeminfo" class
This API call will return a list of external mounts
on the system

TYPE: UNKNOWN/USB/HDRIVE/DVD/SDCARD

REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
   "action" : "externalmounts"
}

REST Response:
-------------------------------
{
    "args": {
        "externalmounts": {
            "/dev/fuse": {
                "filesystem": "fusefs",
                "path": "/usr/home/kris/.gvfs",
                "type": "UNKNOWN"
            }
        }
    }
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "namespace" : "sysadm",
   "name" : "systeminfo",
   "args" : {
      "action" : "externalmounts"
   }
}

WebSocket Response:
-------------------------------
{
  "args": {
    "externalmounts": {
      "/dev/fuse": {
        "filesystem": "fusefs",
        "path": "/usr/home/kris/.gvfs",
        "type": "UNKNOWN"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-20 12:13:25 -05:00
Ken Moore
0077d68208 Commit some debugging work on the sysadm server. 2016-01-18 16:53:12 -05:00
Kris Moore
766305dcdf Add new "update" API class with the first "checkupdates" action for
testing. We will add an API call for doc'ing once we troubleshoot
some issues
2016-01-18 15:07:57 -05:00
Ken Moore
f30b6cf947 Finish up the overhaul of the Events subsystem and start adding in the Life Preserver event handling/systems. 2016-01-18 12:37:40 -05:00
Kris Moore
84cb7bb19d Add new API call to run replication tasks manually
REST Request:
-------------------------------
PUT /sysadm/lifepreserver
{
   "host" : "10.0.10.100",
   "dataset" : "mypool",
   "action" : "runreplication"
}

REST Response:
-------------------------------
{
    "args": {
        "runreplication": {
            "dataset": "mypool",
            "host": "10.0.10.100"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "name" : "lifepreserver",
   "args" : {
      "host" : "10.0.10.100",
      "dataset" : "mypool",
      "action" : "runreplication"
   },
   "namespace" : "sysadm"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "runreplication": {
      "dataset": "mypool",
      "host": "10.0.10.100"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-15 12:11:01 -05:00
Kris Moore
f31d53587f Add new API call to remove a replication task / target
REST Request:
-------------------------------
PUT /sysadm/lifepreserver
{
   "dataset" : "tank",
   "host" : "192.168.0.10",
   "action" : "removereplication"
}

REST Response:
-------------------------------
{
    "args": {
        "removereplication": {
            "dataset": "tank",
            "host": "192.168.0.10"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "args" : {
      "action" : "removereplication",
      "dataset" : "tank",
      "host" : "192.168.0.10"
   },
   "name" : "lifepreserver",
   "namespace" : "sysadm"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "removereplication": {
      "dataset": "tank",
      "host": "192.168.0.10"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-15 12:01:28 -05:00
Kris Moore
97e8af86cf New API call for lifepreserver. This one lists the replication
targets on a system

While here, update api-test.sh to save response to /tmp/api-response, so we dont
need to always cut-n-paste

REST Request:
-------------------------------
PUT /sysadm/lifepreserver
{
   "action" : "listreplication"
}

REST Response:
-------------------------------
{
    "args": {
        "listreplication": {
            "tank1->192.168.0.9": {
                "dataset": "tank1",
                "frequency": "22",
                "host": "192.168.0.9",
                "port": "22",
                "rdset": "tank/backups",
                "user": "backups"
            }
        }
    }
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "args" : {
      "action" : "listreplication"
   },
   "id" : "fooid",
   "name" : "lifepreserver"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "listreplication": {
      "tank1->192.168.0.9": {
        "dataset": "tank1",
        "frequency": "22",
        "host": "192.168.0.9",
        "port": "22",
        "rdset": "tank/backups",
        "user": "backups"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-15 10:40:03 -05:00
Kris Moore
48d7108529 Add a new API call to (re)init the replication on the remote
side via life-preserver

dataset = The local dataset/pool you are replicating
host = The target for replication, either IP or hostname

REST Request:
-------------------------------
PUT /sysadm/lifepreserver
{
   "dataset" : "tank1",
   "host" : "192.168.0.9",
   "action" : "initreplication"
}

REST Response:
-------------------------------
{
    "args": {
        "initreplication": {
            "dataset": "tank1",
            "host": "192.168.0.9"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "args" : {
      "host" : "192.168.0.9",
      "dataset" : "tank1",
      "action" : "initreplication"
   },
   "namespace" : "sysadm",
   "name" : "lifepreserver"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "initreplication": {
      "dataset": "tank1",
      "host": "192.168.0.9"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-14 15:17:25 -05:00
Ken Moore
ec7f25d804 Add a new API call: namespace=rpc, name=query
This will probe all the known subsystems and return which ones are currently available and what level of access the user has (read/write).

REST Request:
-------------------------------
PUT /rpc/query
{
   "junk" : "junk"
}

REST Response:
-------------------------------
{
    "args": {
        "rpc/dispatcher": "read/write",
        "rpc/syscache": "read",
        "sysadm/lifepreserver": "read/write",
        "sysadm/network": "read/write"
    }
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "name" : "query",
   "namespace" : "rpc",
   "args" : {
      "junk" : "junk"
   }
}

WebSocket Response:
-------------------------------
{
  "args": {
    "rpc/dispatcher": "read/write",
    "rpc/syscache": "read",
    "sysadm/lifepreserver": "read/write",
    "sysadm/network": "read/write"
  },
  "id": "fooid",
  "name": "response",
  "namespace": "rpc"
}
2016-01-13 14:21:45 -05:00
Kris Moore
5bb6fb7d33 Add new API call for creating a replication task in Life-Preserver
host = <Remote hostname/ip>
port = <SSH port>
password = <Your SSH password>
dataset = <Local Dataset to replicate>
remotedataset = <Target location for remote dataset>
frequency = <time> XX/sync/hour/30min/10min/manual
            XX= Time to perform replication (in 24 hour notation)
          sync= Do replication with snaps (Not recommended for frequent snaps)
          hour= Replicate hourly
         30min= Replicate every 30 minutes
         10min= Replicate every 10 minutes
        manual= Only replicate when requested by user

REST Request:
-------------------------------
PUT /sysadm/lifepreserver
{
   "action" : "addreplication",
   "password" : "mypass",
   "dataset" : "tank1",
   "remotedataset" : "tank/backups",
   "user" : "backupuser",
   "frequency" : "22",
   "port" : "22",
   "host" : "192.168.0.10"
}

REST Response:
-------------------------------
{
    "args": {
        "addreplication": {
            "frequency": "22",
            "host": "192.168.0.10",
            "ldataset": "tank1",
            "port": "22",
            "rdataset": "tank/backups",
            "user": "backupuser"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "name" : "lifepreserver",
   "args" : {
      "action" : "addreplication",
      "user" : "backupuser",
      "dataset" : "tank1",
      "frequency" : "22",
      "port" : "22",
      "password" : "mypass",
      "host" : "192.168.0.10",
      "remotedataset" : "tank/backups"
   },
   "id" : "fooid"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "addreplication": {
      "frequency": "22",
      "host": "192.168.0.10",
      "ldataset": "tank1",
      "port": "22",
      "rdataset": "tank/backups",
      "user": "backupuser"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-12 16:53:46 -05:00
Kris Moore
4158f4589c Add new API call to save system-wide settings for life-preserver
duwarn = XX (Percentage, 1-99)
email = Email address to send notifications to
emailopts = ALL/WARN/ERROR (All mail, warnings + errors, or errors only)
recursive = true/false (Do recursive operations on all ZFS snap)

REST Request:
-------------------------------
PUT /sysadm/lifepreserver
{
   "emailopts" : "ALL",
   "duwarn" : "70",
   "recursive" : "true",
   "action" : "savesettings",
   "email" : "kris@example.org"
}

REST Response:
-------------------------------
{
    "args": {
        "savesettings": {
            "duwarn": "70",
            "email": "kris@example.org",
            "emailopts": "ALL",
            "recursive": "true"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "emailopts" : "ALL",
      "action" : "savesettings",
      "duwarn" : "70",
      "recursive" : "true",
      "email" : "kris@example.org"
   },
   "id" : "fooid",
   "namespace" : "sysadm",
   "name" : "lifepreserver"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "savesettings": {
      "duwarn": "70",
      "email": "kris@example.org",
      "emailopts": "ALL",
      "recursive": "true"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-12 14:39:10 -05:00
Kris Moore
399bfb3814 Add new API call to remove ZFS snapshots from a dataset / pool
REST Request:
-------------------------------
PUT /sysadm/lifepreserver
{
   "dataset" : "tank1/usr/jails",
   "snap" : "auto-2016-01-09-18-00-00",
   "action" : "removesnap"
}

REST Response:
-------------------------------
{
    "args": {
        "removesnap": {
            "dataset": "tank1/usr/jails",
            "snap": "auto-2016-01-09-18-00-00"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "snap" : "auto-2016-01-09-18-00-00",
      "action" : "removesnap",
      "dataset" : "tank1/usr/jails"
   },
   "name" : "lifepreserver",
   "namespace" : "sysadm",
   "id" : "fooid"
}

WebSocket Response:
-------------------------------
{
  "args": {
     "removesnap": {
        "dataset": "tank1/usr/jails",
        "snap": "auto-2016-01-09-18-00-00"
     }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-12 13:51:24 -05:00
Kris Moore
c506bcccb5 Add new API call for reverting a dataset back to a
specific snapshot

REST Request:
-------------------------------
PUT /sysadm/lifepreserver
{
   "snap" : "auto-2016-01-09-18-00-00",
   "dataset" : "tank1/usr/jails",
   "action" : "revertsnap"
}

REST Response:
-------------------------------
{
    "args": {
        "revertsnap": {
            "dataset": "tank1/usr/jails",
            "snap": "auto-2016-01-09-18-00-00"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "dataset" : "tank1/usr/jails",
      "action" : "revertsnap",
      "snap" : "auto-2016-01-09-18-00-00"
   },
   "namespace" : "sysadm",
   "name" : "lifepreserver",
   "id" : "fooid"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "revertsnap": {
      "dataset": "tank1/usr/jails",
      "snap": "auto-2016-01-09-18-00-00"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-12 13:36:42 -05:00
Kris Moore
cbf3ce8b8b Add new API call to schedule a cron scrub
Frequency Options: none, daily@XX, weekly@YY@XX, monthly@ZZ@XX
XX = Hour to execute, YY = Day of week to execute, ZZ = Day of month

REST Request:
-------------------------------
PUT /sysadm/lifepreserver
{
   "action" : "cronscrub",
   "pool" : "tank",
   "frequency" : "daily@22"
}

REST Response:
-------------------------------
{
    "args": {
        "cronscrub": {
            "frequency": "daily@22",
            "pool": "tank"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "cronscrub",
      "pool" : "tank",
      "frequency" : "daily@22"
   },
   "namespace" : "sysadm",
   "name" : "lifepreserver",
   "id" : "fooid"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "cronscrub": {
      "frequency": "daily@22",
      "pool": "tank"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-12 12:12:19 -05:00
Kris Moore
4c562a85b2 Add a new API call to create snapshot schedules for LifePreserver
REST Request:
-------------------------------
PUT /sysadm/lifepreserver
{
   "pool" : "mytank",
   "keep" : "10",
   "frequency" : "daily@11",
   "action" : "cronsnap"
}

REST Response:
-------------------------------
{
    "args": {
        "cronsnap": {
            "frequency": "daily@11",
            "keep": "10",
            "pool": "mytank"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "cronsnap",
      "keep" : "10",
      "frequency" : "daily@11",
      "pool" : "mytank"
   },
   "namespace" : "sysadm",
   "name" : "lifepreserver",
   "id" : "fooid"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "cronsnap": {
      "frequency": "daily@11",
      "keep": "10",
      "pool": "mytank"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-08 15:52:09 -05:00
Kris Moore
9160af8912 Add a new API call for sysadm/lifepserver which returns the system-wide
settings of the utility

REST Request:
-------------------------------
PUT /sysadm/lifepreserver
{
   "action" : "settings"
}

REST Response:
-------------------------------
{
    "args": {
        "settings": {
            "diskwarn": "85%",
            "email": "WARN",
            "emailaddress": "krismoore134@gmail.com",
            "recursive": "ON"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "args" : {
      "action" : "settings"
   },
   "namespace" : "sysadm",
   "name" : "lifepreserver"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "settings": {
      "diskwarn": "85%",
      "email": "WARN",
      "emailaddress": "krismoore134@gmail.com",
      "recursive": "ON"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-01-08 14:47:55 -05:00
Kris Moore
1ceb256922 Add the new listsnap API call 2016-01-08 13:48:51 -05:00
Kris Moore
528c247607 Add LifePreserver API first list-cron call 2016-01-05 13:19:01 -05:00
Ken Moore
b1e451b385 Adjust the new sysadm/network function a bit - just add proper error code handling if nothing was performed. 2016-01-04 15:07:53 -05:00
Ken Moore
ace6c2ca4c Add a new subsystem to sysadm-server: the sysadm-network device information system.
To Access:
namespace="sysadm"
name="network"
args={"action" : "list-devices"}

Output arguments structure:
"<device name>" : {
 "ipv4" : <value>,
 "ipv6" : <value>,
 "netmask" : <value>,
 "description" : <value>,
 "MAC" : <value>,
 "status" : <value>,
 "is_active" : [true/false],
 "is_dhcp" : [true/false],
 "is_wireless" : [true/false]
}
2016-01-04 14:29:04 -05:00
Ken Moore
8d57413401 A few more updates to the input message parsing systems for the server: Ensure that both the namespace and the name of the input message are passed through to the backend parser/system (if authorized). 2016-01-04 13:30:49 -05:00
Ken Moore
508e025cea Make sure the port numbers get changed a bit, and fix some complication issues in the new backend. 2015-12-29 12:54:01 -05:00
Ken Moore
9a161644d1 Merge branch 'master' of github.com:pcbsd/sysadm 2015-12-17 17:16:06 -05:00
Ken Moore
39f36d1d4f Furthur cleanup the sysadm subsystem request forwarding mechanisms so it is easier to extend later. The return/error code for each subsystem is not used yet - will finish that within the websocket later, but the general backend systems are now setup. 2015-12-17 17:12:19 -05:00
Kris Moore
a0ae49496b Fix some issues compiling sysadm locally without it installed to
/usr/local
2015-12-17 14:19:29 -05:00