mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 02:20:17 +00:00
API CHANGE: sysadm/iocage - "action"="listplugins"
Add this API call to list all the available plugins for iocage.
REST Request (example):
-------------------------------
PUT /sysadm/iocage
{
"action" : "listplugins"
}
WebSocket Request:
-------------------------------
{
"namespace" : "sysadm",
"args" : {
"action" : "listplugins"
},
"name" : "iocage",
"id" : "fooid"
}
Response:
-------------------------------
{
"args": {
"listplugins": {
"remote": {
"btsync": {
"description": "Resilient, fast and scalable file sync software for enterprises and individuals.",
"id": "btsync",
"name": "BitTorrent Sync"
},
"couchpotato": {
"description": "CouchPotato is an automatic NZB and torrent downloader.",
"id": "couchpotato",
"name": "CouchPotato"
},
"crashplan": {
"description": "Computer backup and data storage made simple.",
"id": "crashplan",
"name": "Crashplan"
},
"deluge": {
"description": "Bittorrent client using Python, and libtorrent-rasterbar",
"id": "deluge",
"name": "Deluge"
},
"emby": {
"description": "Home media server built using mono and other open source technologies",
"id": "emby",
"name": "Emby"
},
"gitlab": {
"description": "Powerful features for modern software development",
"id": "gitlab",
"name": "GitLab"
},
"jenkins": {
"description": "Jenkins CI",
"id": "jenkins",
"name": "Jenkins"
},
"jenkins-lts": {
"description": "Jenkins CI (Long Term Support Version)",
"id": "jenkins-lts",
"name": "Jenkins (LTS)"
},
"madsonic": {
"description": "Open-source web-based media streamer and jukebox.",
"id": "madsonic",
"name": "MadSonic"
},
"nextcloud": {
"description": "Access, share and protect your files, calendars, contacts, communication & more at home and in your enterprise.",
"id": "nextcloud",
"name": "NextCloud"
},
"plexmediaserver": {
"description": "The Plex media server system",
"id": "plexmediaserver",
"name": "Plex Media Server"
},
"plexmediaserver-plexpass": {
"description": "The Plex media server system",
"id": "plexmediaserver-plexpass",
"name": "Plex Media Server (PlexPass)"
},
"quasselcore": {
"description": "Quassel Core is a daemon/headless IRC client, part of Quassel, that supports 24/7 connectivity. Quassel Client can be attached to it to.",
"id": "quasselcore",
"name": "Quasselcore"
},
"sickrage": {
"description": "Automatic Video Library Manager for TV Shows",
"id": "sickrage",
"name": "SickRage"
},
"sonarr": {
"description": "PVR for Usenet and BitTorrent users",
"id": "sonarr",
"name": "Sonarr"
},
"subsonic": {
"description": "Open-source web-based media streamer and jukebox.",
"id": "subsonic",
"name": "SubSonic"
},
"syncthing": {
"description": "Personal cloud sync",
"id": "syncthing",
"name": "Syncthing"
},
"transmission": {
"description": "Fast and lightweight daemon BitTorrent client",
"id": "transmission",
"name": "Transmission"
}
}
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
Changelog: yes
This commit is contained in:
@@ -715,6 +715,7 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmIocageRequest(const QJsonVal
|
||||
ok = true;
|
||||
out->insert("listjails", sysadm::Iocage::listReleases());
|
||||
}*/
|
||||
else if(act=="listplugins"){ retObj = sysadm::Iocage::listPlugins(); }
|
||||
ok = !retObj.keys().isEmpty();
|
||||
if(ok){ out->insert(act,retObj); }
|
||||
} //end of "action" key usage
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
using namespace sysadm;
|
||||
|
||||
// ============ GLOBAL OPTIONS ==============
|
||||
// Current activation status
|
||||
// Current activation status
|
||||
// ##NOT-WORKING in 5/23/17 build of iocage (0.9.8.1)##
|
||||
QJsonObject Iocage::activateStatus(){
|
||||
QJsonObject retObject;
|
||||
bool success = false;
|
||||
@@ -126,13 +127,20 @@ QJsonObject Iocage::listReleases(){
|
||||
|
||||
QJsonObject Iocage::listPlugins(){
|
||||
QJsonObject retObject;
|
||||
//Not sure about format of this yet (just commited upstream) - just treat it as line-delimited for now. (2/16/17)
|
||||
//locally downloaded plugins
|
||||
QStringList local = General::RunCommand("iocage list -ph ").split("\n");
|
||||
retObject.insert("local", QJsonArray::fromStringList(local) );
|
||||
//Remote plugins available for download/use
|
||||
QStringList remote = General::RunCommand("iocage list -Ph").split("\n");
|
||||
retObject.insert("remote", QJsonArray::fromStringList(remote));
|
||||
QJsonObject plugins;
|
||||
for(int i=0; i<remote.length(); i++){
|
||||
if(remote[i].startsWith("[")){ remote[i] = remote[i].section("]",1,-1); }
|
||||
else{ remote.removeAt(i); i--; continue; }
|
||||
//Now parse the line and put it into the plugins object
|
||||
QJsonObject obj;
|
||||
obj.insert("name", remote[i].section(" - ",0,0).simplified());
|
||||
obj.insert("description", remote[i].section(" - ",1,-1).section("(",0,-2).simplified());
|
||||
obj.insert("id", remote[i].section("(",-1).section(")",0,0).simplified());
|
||||
plugins.insert(obj.value("id").toString(), obj);
|
||||
}
|
||||
retObject.insert("remote", plugins);
|
||||
return retObject;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user