Commit Graph

314 Commits

Author SHA1 Message Date
Kris Moore
30ffeccfd4 Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-02-09 12:08:03 -05:00
Kris Moore
c3c809fcbc Add new API call to do the initial setup of Iohyve
Both the pool/nic are required for setup to complete.

REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "nic" : "re0",
   "pool" : "tank",
   "action" : "setup"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "name" : "iohyve",
   "args" : {
      "pool" : "tank",
      "nic" : "re0",
      "action" : "setup"
   },
   "namespace" : "sysadm"
}

Response:
-------------------------------
{
  "args": {
    "setup": {
      "nic": "re0",
      "pool": "tank"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-09 12:07:12 -05:00
JoshDW19
f58eb8ce08 New API call for creating a new boot environment. An optional flag is shown below.
By specifying clonefrom which passes along the -e flag it will clone from a inactive boot environment.

REST Request:
-------------------------------
PUT /sysadm/beadm
{
   "action" : "createbe",
   "newbe" : "red",
   "clonefrom" : "green"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "args" : {
      "newbe" : "red",
      "clonefrom" : "green",
      "action" : "createbe"
   },
   "namespace" : "sysadm",
   "name" : "beadm"
}

Response:
-------------------------------
{
  "args": {
    "createbe": {
      "clonefrom": "green",
      "newbe": "red"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-09 11:49:39 -05:00
JoshDW19
6a3ffaa308 Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-02-09 10:36:44 -05:00
JoshDW19
f9e5dc615d API call for activating a different boot environment
REST Request:
-------------------------------
PUT /sysadm/beadm
{
   "target" : "bootthingy",
   "action" : "activatebe"
}

WebSocket Request:
-------------------------------
{
   "name" : "beadm",
   "args" : {
      "action" : "activatebe",
      "target" : "bootthingy"
   },
   "namespace" : "sysadm",
   "id" : "fooid"
}

Response:
-------------------------------
{
  "args": {
    "activatebe": {
      "target": "bootthingy"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-09 10:35:37 -05:00
Ken Moore
787369def3 Change the default reply code for an invalid subsystem to 400 BadRequest instead of 404 NoContent. 2016-02-09 09:57:50 -05:00
Ken Moore
f775458d31 Merge branch 'master' of github.com:pcbsd/sysadm 2016-02-09 09:19:20 -05:00
Ken Moore
e1b9bc833c Fix up the detection of the localhost address when there is both IPv4 and IPv6 information available for the connection. 2016-02-09 09:18:21 -05:00
dlavigne
6dc31f5254 Doc renamebe action. 2016-02-08 15:25:27 -05:00
Kris Moore
5b140b8c6e Remove bad lock file 2016-02-08 14:27:25 -05:00
JoshDW19
10e9423d61 Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-02-08 14:26:13 -05:00
JoshDW19
6d8815a220 Really cool message because I forgot to include the modified webackend.cpp in the last commit. 2016-02-08 14:25:40 -05:00
JoshDW19
849230bf2f Add API call for BEADM to rename a boot environment
REST Request:
-------------------------------
PUT /sysadm/beadm
{
   "source" : "newname",
   "action" : "renamebe",
   "target" : "bootthingy"
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "name" : "beadm",
   "id" : "fooid",
   "args" : {
      "source" : "newname",
      "target" : "bootthingy",
      "action" : "renamebe"
   }
}

Response:
-------------------------------
{
  "args": {
    "renamebe": {
      "source": "newname",
      "target": "bootthingy"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
2016-02-08 14:24:16 -05:00
Kris Moore
75fd288768 Added doctoc 2016-02-08 14:12:48 -05:00
Kris Moore
20114a9d04 Add few more line-breaks 2016-02-08 13:31:39 -05:00
Kris Moore
d6ece0f201 Add some line-breaks 2016-02-08 13:31:00 -05:00
Kris Moore
ccd73e7270 Update the various lpreserver API backends, to use new CLI
syntax, and uppdate README with further information about testing
2016-02-08 13:12:06 -05:00
Kris Moore
0300aab643 Update API test script to use 'sudo' if running as user and
needing to pkg install utils
2016-02-08 12:30:27 -05:00
Kris Moore
172962421c Fix required modules section 2016-02-08 11:37:49 -05:00
Kris Moore
1110170081 Update the SysAdm README with much more useful information 2016-02-08 11:35:12 -05:00
dlavigne
48a9463262 Add beadm class. 2016-02-05 13:23:29 -05:00
dlavigne
8f3b7ec2e0 Doc cleanall action. 2016-02-05 13:02:40 -05:00
dlavigne
6b3a2750f8 Doc cleanreleases action. 2016-02-05 12:29:56 -05:00
dlavigne
9c5df4348c Doc cleanreleases action. 2016-02-05 12:11:38 -05:00
dlavigne
8760097189 Doc cleanjails action. 2016-02-05 11:56:34 -05:00
dlavigne
91358a6b35 Doc capjail action. 2016-02-05 11:46:36 -05:00
dlavigne
8f431e81c6 Doc rmiso command. 2016-02-05 11:06:53 -05:00
Kris Moore
23d5136e22 Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-02-05 11:04:09 -05:00
Kris Moore
1ba65b3388 Add new API class and call for 'beadm', with the initial listbes
API call

REST Request:
-------------------------------
PUT /sysadm/beadm
{
   "action" : "listbes"
}

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

Response:
-------------------------------
{
  "args": {
    "listbes": {
      "11.0-CURRENTJAN2016-up-20160128_150853": {
        "active": "NR",
        "date": "2016-01-28",
        "mount": "/",
        "nick": "14:57",
        "space": "10.2G"
      },
      "initial": {
        "active": "-",
        "date": "2016-01-28",
        "mount": "-",
        "nick": "07:00",
        "space": "1.2G"
      }
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-05 11:02:47 -05:00
dlavigne
b7d4a52981 Doc renameiso action. 2016-02-05 10:59:38 -05:00
dlavigne
24295f65a1 Doc fetchiso action. 2016-02-05 08:53:13 -05:00
dlavigne
208ce54e98 Clarify description for deactivatepool. 2016-02-05 08:40:21 -05:00
Brandon Schneider
5cde5b594d Add new iocage API to clean all.
REST Request:
-------------------------------
PUT /sysadm/iocage
{
   "action" : "cleanall"
}

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

Response:
-------------------------------
{
  "args": {
    "cleanall": {
      "success": "All iocage datasets have been cleaned."
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-04 22:39:32 -06:00
Brandon Schneider
285002d9e8 Add new iocage API call to clean all templates.
REST Request:
-------------------------------
PUT /sysadm/iocage
{
   "action" : "cleantemplates"
}

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

Response:
-------------------------------
{
  "args": {
    "cleantemplates": {
      "success": "All templates have been cleaned."
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-04 22:36:02 -06:00
Brandon Schneider
920a51f997 Add new iocage API call to clean all RELEASEs
REST Request:
-------------------------------
PUT /sysadm/iocage
{
   "action" : "cleanreleases"
}

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

Response:
-------------------------------
{
  "args": {
    "cleanreleases": {
      "success": "All RELEASEs have been cleaned."
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-04 22:34:01 -06:00
Brandon Schneider
dbbcf44d35 Add new iocage API call to clean all jails.
REST Request:
-------------------------------
PUT /sysadm/iocage
{
   "action" : "cleanjails"
}

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

Response:
-------------------------------
{
  "args": {
    "cleanjails": {
      "success": "All jails have been cleaned."
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-04 22:31:19 -06:00
Brandon Schneider
27cc7f279e Add new iocage API call to cap a jail.
REST Request:
-------------------------------
PUT /sysadm/iocage
{
   "jail" : "test",
   "action" : "capjail"
}

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

Response:
-------------------------------
{
  "args": {
    "capjail": {
      "success": "jail test capped."
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-04 22:00:26 -06:00
JoshDW19
5cb8dcf026 Add new API call to iohyve to remove a iso dataset
Target is the iso we are removing from iohyve

REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "action" : "rmiso",
   "target" : "FreeBSD-10.2-RELEASE-amd64-bootonly.iso"
}

WebSocket Request:
-------------------------------
{
   "id" : "fooid",
   "name" : "iohyve",
   "args" : {
      "target" : "FreeBSD-10.2-RELEASE-amd64-bootonly.iso",
      "action" : "rmiso"
   },
   "namespace" : "sysadm"
}

Response:
-------------------------------
{
  "args": {
    "rmiso": {
      "target": "FreeBSD-10.2-RELEASE-amd64-bootonly.iso"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-04 15:53:45 -05:00
Kris Moore
4d3b590f46 Add new API call to iohyve to rename an existing ISO file on
disk

REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "source" : "test.iso",
   "target" : "102.iso",
   "action" : "renameiso"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "target" : "102.iso",
      "source" : "test.iso",
      "action" : "renameiso"
   },
   "id" : "fooid",
   "name" : "iohyve",
   "namespace" : "sysadm"
}

Response:
-------------------------------
{
  "args": {
    "renameiso": {
      "source": "test.iso",
      "target": "102.iso"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-04 15:23:44 -05:00
Kris Moore
a727b4a8a2 Add new API call to fetch an ISO for iohyve
Uses the "url" argument, which should be the address understood by "fetch" to
grab an ISO from, I.E. http://, ftp://, file://, etc

The task will queue, and return an event when finished

REST Request:
-------------------------------
PUT /sysadm/iohyve
{
   "url" : "ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/ISO-IMAGES/10.1/FreeBSD-10.1-RELEASE-amd64-disc1.iso",
   "action" : "fetchiso"
}

WebSocket Request:
-------------------------------
{
   "namespace" : "sysadm",
   "name" : "iohyve",
   "args" : {
      "url" : "ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/ISO-IMAGES/10.1/FreeBSD-10.1-RELEASE-amd64-disc1.iso",
      "action" : "fetchiso"
   },
   "id" : "fooid"
}

Response:
-------------------------------
{
  "args": {
    "fetchiso": {
      "command": "iohyve fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/ISO-IMAGES/10.1/FreeBSD-10.1-RELEASE-amd64-disc1.iso",
      "comment": "Task Queued",
      "queueid": "{b3a8b980-a564-4ff8-86a2-1971bd4f58d1}"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
2016-02-04 14:58:29 -05:00
dlavigne
dda2ede751 Add new iohyve class. 2016-02-04 13:07:31 -05:00
dlavigne
40f629230a Doc deactivatepool action. 2016-02-04 12:43:29 -05:00
dlavigne
b848d76be0 Doc activatepool action. 2016-02-04 11:47:21 -05:00
Kris Moore
21d016e3b8 Merge branch 'master' of https://github.com/pcbsd/sysadm 2016-02-04 11:37:25 -05:00
Kris Moore
a17cc0b7e4 Update the api-test script, now we only "simulate" the REST request
and show the same reponse from websockets. This prevents issues
from running API requests two times in a row

Also, add support for ENV variables to be used, instead of interactive
elements
2016-02-04 11:36:30 -05:00
dlavigne
e899e2c678 Doc stopjail action. 2016-02-04 11:30:06 -05:00
dlavigne
521e7f9ec8 Doc startjail action. 2016-02-04 11:21:18 -05:00
dlavigne
ee8fa9d436 Doc setsysctl action. 2016-02-04 11:07:54 -05:00
dlavigne
661c0e8cbe Doc sysctllist action. 2016-02-04 10:58:58 -05:00
dlavigne
916cbaff6e Doc killproc action. 2016-02-04 10:51:54 -05:00