-
Intro
This is about DEDS and how it works.
All the commands are called like yourserver.name:port/command/name/
appkey and serverkey are set in header as DE_APPKEY and DE_SERVERKEY on request
If data needs to be sent, a json string is sent using POST to the server. All of this is done for you in the Python library for using DEDS that follows DG3 and deserver.
For deserver, you will mostly only use serverkey to get the key to use by logging into the server and then use db commands for all tables, forms and file updates.
Command Which How it works appfiles appname This command are used to collect all files that are part of the web application and not a part of a DataEase application.
For a DG3 app that is all files except for those found in Data in the app folder or the repository if Data not in the application folder.
A excludepaths list are sent with the request to tell what folders not to include in the list of files. This is set direct into the deployed definition.
Security: need serverkey and repokey
apphash appname The server is supplied with a list of files we want hashes for i a array named file list.
Security: need serverkey and repokeydbappobjs appname Get form definitions for the application from server. Read all but the names in a exclude list sent to the server in json['excludeforms'] string array.
Return a list of all appobjects in res['formdata'] that have formname as key and a object as value where 'appobj' holds the Application Objects record as value. More data like ardl and relationships will be added to the object based on input parameters.dbdefs appname Get the table definition of the remote DataEase app. This will later be used to patch db that are not owned by developer.
Security: need serverkey and repokeydbexist appname Check if database for named configuration exist on server. The file list consist on a array of strings based first on the applications exclude list stored in 'dbappexcludefiles'. Then it will go trough all other app it either owns or are a part of (stored in 'dpartof' if this app are owned by someone else and 'down' if this app owns others.
Security Nonedbformdefs appname Get a list of forms and return a 'fdefs' as a dict with the formname as key and the definition of each form as value. The dict will also have repoletter - the letter used at position 5 in db files is this repo.
Each form definition will consist of:
tablename - name of the table the form uses if any or None or '' if not using table
formname - name of the form if found or None if not
tabledef - the definition of the table with file list
'rdrridx' : idx,
'rdrrrecord' : rdrrec,
'files' : rdrfiles,
'filesdata' : {filename : [filepath,filetime,filesize],...}
formdef - the defintion and the form file used if it exists
'formfile' : filename,
'formdata' : rec,
'filedata' : [filepath,filetime,filesize]dbappexcludefiles appname Return a list of files that you should not do anything with. The path list consist on a array of strings based first on the applications exclude list stored in 'dbappexcludepaths'. Then it will go trough all other app it either owns or are a part of (stored in 'dpartof' if this app are owned by someone else and 'down' if this app owns others.
Security: need serverkey and repokeydbappexcludepaths appname Return a list of directories under the repopath that you should not do anything with.
Security: need serverkey and repokeydbappfiles appname Get a list of all files that is not data files for tables or indexes. To accommodate separate development of more than one application for server, we exclude directories that are used by each server definition. For now that is static. A file list is also added but that is empty at the moment. For server application the static folder will be the appfiles and updated by that process.
Security: need serverkey and repokeydbapphash appname Get a list of files and calculates a hash for each file
Security: need serverkey and repokeydbappdatafilescheck appname Check if files in DataEase app that not are data files need to be replaced.
Security: need serverkey and repokey
Takes json object with datafiles as key with a array consisting of array of [fname,size,calchash] from sender files and do a compare with server side files by first check if exist, then filesize and if all equal do a dbdiff.calchash on the file. If Still equal, then nothing should be done.
Return a result with 'datafileschecked' the is a array of arrays with [fname, command]. The command can be Nothing if file is equal or Copy if not equal.dbinstall appname Check if there are any job to be done on the DataEase repository at definition level. If there are jobs update the table definitions.
Security: need serverkey and repokeydbappinstall appname This takes all files that not are data like frm and images, or dql scripts and copy them in. It also patches up tables that are owned by the developer like Relations, Application Objects, $DeARDL_Registry$, $$DQLStore$$ and Webserver.
Security: need serverkey and repokey check if the local version is the same.
Input a JSON with 'jobs', 'dbappfiles', 'dbappdatafiles' and 'equaldbappfiles' that works as decribed in dbappinstall document.dbupdatereposettings appname Used to change just the 4 repository settings in a app. Takes 4 parameters in a json body (reponame, repopath, repoun and repopw) and set the server side version (dreponame, drepopath, drepoun and drepopw) with these values. Used to connect to a repo or change un/pw in gui. scheduledefs appname Get the definitions on scheduled DG3 services. Uses com commands to read the defined schedules. Schedules have a prefix on the server DG3DS_[dname]_[localname]
Security: need serverkey and repokeyschedulecheck appname Check if the scheduled DG3 task in Windows task scheduler is installed. Always return needs update in this version.
Security: need serverkey and repokeyscheduleinstall appname Set up windows task using pythoncom
Security: need serverkey and repokeysearchdefs appname Get a list of installed search definition in DG3. Current version always tell to update.
Security: need serverkey and repokeysearchinstall appname Set up search for DG3 application
Security: need serverkey and repokeyserverkey appname With this function, you can read the server key form the server by posting a username and password to the server in a json object and the app name in the url. Then this can be used for security for all the other calls by setting the key as 'dkey' in deploysettings any of the RemoteDeployment objects and call the DEDS server with rpost or rget. uploadfile appname Upload a file for a named application to a temp area. All data files and data app files are uploaded to temp\Appname\Data
Security Nonewebappbackup appname Take a backup of the current repo to a zip file named backup + appname + epoctime + .zip and stores it in the directory set in settings downloadpath. Returns zipfilename, zipfilepath and zipurl in a json object.
Security serverkeywebappconfigcreate appname Send the definition you want created and username, password as a json string. A iiskey for that user and the updated settings are returned.
Security loginwebappconfigexist appname Test if a config with this name is already there
Security nonewebappconfigget appname Send username and password in a json string to the server and get iiskey for that user and settings back.
Security loginwebappcreate appname webappexist appname Ask if the server has a app installed with the given name. Return a json with result "OK" and doexist true. The test done is to check if drepopath and dappdir existts.
If app exsists json will hold at least {"result" : "OK", "doexist" : true}
if app do not exist json will hold at least {"result" : "OK", "doexist" : false}webappinstall appname Copy all updated applicaton files to the correct places. If we are a DG3 application we also updates the settings.py file in this operation with relevant settings for the app definition.
Security: need serverkey and repokeywebappservicecreate appname If deserver we use the same start script for the app service as the standalone script. If the script is not created we create it. We install that with nssm with the name DES - dname and set appasservice to True. For DG3 this should not be used on IIS any more.
Security: need serverkey and repokeywebappservicecreatescript appname This is the one to call to create the script to start a application. For deserver this is a simple batch file that starts the server with paramters and the script is stored with the config as DES_dname.bat
Security: need serverkey and repokeywebappserviceremove appname If deserver call nssm remove with the service name DES - dname and set appasservice to False For DG3 this should not be used on IIS any more.
Security: need serverkey and repokeywebappsettings appname Can read and write settings from the server on this. A GET is read and return json. A POST is write and expects a json as data.
Security: To do anything you need a server key. If application do not exist on server, dsversion, webservertype and webappexist false is returned. If there is a app a repokey is needed as well and if you have that you will get the app config with a GET and update it with a POST.webappstart appname Check if app is deployed as service and if so starts the service. DG3 apps will have service name "DG3 - dname" and deserver will have name "DES - dname". If not a service then check if deserver or not. DG3, will start de django app (not in use for IIS). The deserver will check if startup script is created and create if not, then it will start the script (located in TheDeployed with name DES_dname.bat) and store the pid in settings.
Security: need serverkey and repokeywebappstop appname Check if app is deployed as service and if so stop the service. DG3 apps will have service name "DG3 - dname" and deserver will have name "DES - dname". If not a service then lookup pid stored when started and kill the process with that pid.
Security: need serverkey and repokeywebappstatus appname Return status of all parts of application with appname. The result is returned as json in webappstatus and will differ depending on app type and webserver type. The key webapp and webserver can have value Running and Stopped and can be found in all types. The key webappasprocess will have the value true or false depending on if app is run as service : false and as process : true.
On IIS you have a few extra statues code as follows: website Running. Stopped or New.
If apptype is deserver you will also have the following: webappscrip: Exist or Needed and webservice: Exist, Missing or Standalone
Security: need serverkey and repokeywebserverregenconfig None Regenerate the server configuration on none iis server. IIIS do it for one site at a time.
Security: Need valid master serverkey.webserverstart None Start the webserver
Security: Need valid serverkey.webserverstop None Stop the webserver
Security: Need valid serverkey.webserverreload None Stop and Starts the webserver
Security: Need valid serverkey.websitecreate appname Create the site with definition and reverse proxy on iIIS for the application.
Security: Need valid serverkey.websitestart appname For use on IIS, will start the site defined with given name
Security: need serverkey and repokeywebsitestop appname For use on IIS will stop the site defined with given name
Security: need serverkey and repokeywebsiteupdate appname For use on IIS will update site settings if needed
Security: need serverkey and repokey_pingapp None Responds with OK
Security: None needed_whoareyou None Responds with a json with version info
Security: None needed.To use this you must make sure the DEDS have proper rights at the server.name. The webserver commands works with lighttp, (apache, nginx) and IIS. The IIS commands are to one tested for the future, so others might not work anymore.