class apptools.core.rest
extends %CSP.REST
// The REST interface: class that routes HTTP requests
parameter CHARSET = "UTF-8";
Specifies the default character set for the page. This can be overriden using the
<CSP:CONTENT CHARSET=> tag, or by setting the %response.CharSet property
in the OnPreHTTP method. If this parameter is not specified, then
for the default charset is utf-8.
parameter CONTENTTYPE = "application/json";
Specifies the default content type for the page. This can be overriden using the
<CSP:CONTENT TYPE=> tag, or by setting the %response.ContentType property
in the OnPreHTTP method. The default value if this parameter is
not set is text/html.
parameter GN = "^%apptools.Task";
parameter ISCPREFIX = "isc_cache";
classmethod AddNodeJson(obj, icon="", text="", arg="")
as %Status
do ##class(apptools.core.rest).AddNodeJson(jsom,"g","test")
classmethod Authorize(user, password)
as %String
classmethod CustomTask(ns, par="10")
as %Status
http://iris-test:52773/apptoolsrest/custom-task/user/test
http://iris-test:52773/apptoolsrest/custom-task/user/get-item
https://appadmin.demo.community.intersystems.com/apptoolsrest/custom-task/user/zpm-repo-zapm
https://appadmin.demo.community.intersystems.com/apptoolsrest/custom-task/user/zapmrepolist-github-rcemper=repos=fork=0&name=glob
do ##class(apptools.core.rest).CustomTask(1)
classmethod CustomTaskTest(par="10", ByRef json)
as %Status
Test custom module
set ^%apptools.Task("test")=$lb($namespace,"apptools.core.rest","CustomTaskTest")
set ^%apptools.Task("show_logs")=$lb($namespace,,,,"http://iris-test:52773/apptoolsrest/custom-task/test?a=1&b=2","username","pas$w0rd")
classmethod Files(fileId)
as %Status
Method writes files.
/apptoolsrest/get-files/fileId
classmethod FindUser(text="")
as %Status
Search users by context
http://localhost:57772/apptoolsrest/finduser/super
classmethod GetAlerts(days=1, ByRef sys)
as %Status
do ##class(apptools.core.rest).GetAlerts(,.json)
classmethod GetAlertsSys(count=10, ByRef sys, write=1)
as %Status
do ##class(%SYS.System).WriteToConsoleLog("InterSystems Interoperability Test",,3)
do ##class(apptools.core.rest).GetAlertsSys(,.json)
classmethod GetCss(class)
as %Status
Method writes application CSS.
classmethod GetJourSysSummary(par="10", write=1, ByRef sys)
as %Status
do ##class(apptools.core.rest).GetJourSysSummary(10)
set st=##class(apptools.core.rest).GetJourSysSummary(10,0,.json) ;use as function
classmethod GetJs()
as %Status
Method writes application JavaScript.
classmethod GetLastLogs(par=5, json)
as %Status
http://iris-test:52773/apptoolsrest/custom-task/user/run&class=apptools.core.rest&met=GetLastLogs&par=5
http://iris-test:52773/apptoolsrest/custom-task/user/run&class=apptools.core.rest&met=GetLastLogs&par=2024-11-10!2024-11-10!
http://iris-test:52773/apptoolsrest/custom-task/user/run&class=apptools.core.rest&met=GetLastLogs&par=5,yaml
do ##class(apptools.core.rest).GetLastLogs(.par,.json)
classmethod GetTheme(Theme As %String)
as %Status
Method writes application theme.
classmethod Index(class)
as %Status
Method writes application HTML.
classmethod RunCustomTask(data, ByRef json)
as %Status
set st=##class(apptools.core.rest).RunCustomTask(data,.json)
classmethod SaveLog(text="", ByRef json)
as %Status
http://iris-test:52773/apptoolsrest/custom-task/user/run&class=apptools.core.rest&met=SaveLog&par=Text-logs
http://iris-test:52773/apptoolsrest/custom-task/user/run&class=apptools.core.rest&met=SaveLog&par=Text-logs~ClassName=123~MethodName=qwe~Source=345~EventType=asd~Arguments=789
do ##class(apptools.core.rest).SaveLog("text log",.json)
classmethod Test(parameter)
as %Status
classmethod WriteStatic(type As %String, ContentType As %String = "", xDataClass="apptools.core.rest", ClassCSPPage="", IsCached=0, Content="")
Calls StaticContent.Write method or sends not modified header. Type have to be "css" or "js"
d ##class(apptools.core.rest).WriteStatic("html",,,,,text)
classmethod WriteStaticContent(Class As %String, Const As %String)
as %Status
Write the contents of xData tag
classmethod getDBsize(prefix=..#ISCPREFIX_"_dbsize", dbname, int=1, all=0)
as %Status
The size of the database in Gigabytes
do ##class(apptools.core.rest).getDBsize("dbsize",.list) write list
classmethod getDirSize(path="", ByRef res, minsize=10)
as %Status
To sorted sizes subdirs for Linux
kill res set res="" write ##class(apptools.core.rest).getDirSize("/opt2/isc/iris/mgr/",.res,0)
classmethod getListErrProducts(nspace="")
as %Status
http://localhost:57772/apptoolsrest/productslist/-SPGZ
classmethod getProductions(day="1")
as %Status
http://localhost:57772/apptoolsrest/products/0
classmethod getStatic(name As %String, ByRef Description)
as %String
classmethod jsonrpc(ns="", class="", meth="")
as %Status
post http://server:57772/rest/jsonrpc
{"jsonrpc":"2.0","method":"GetInfo","params":{"code":"5007092465"},"id":123}
classmethod jsonrpcError(code, message)
as %Status