Tags:
view all tags
---+ Data API The Data API provides a set of tools you can use to have your APPX applications respond to web based queries. %TOC% ---++ Overview The Data API is a collection of tools that will allow you to easily write subroutines that can respond to web based requests. It is designed to provide an interface between the APPX runtime environment and Web-based services such as a Web server or a mobile application. ---++ Prerequisites The Data API requires: * A sever running nodejs 10 or higher, and a web server * An installation of version 5.5 or higher of the APPX runtime environment * A dedicated APPX username/password set up in the APPX runtime environment for logins * A dedicated APPX Login Manager instance to login to the APPX runtime environment as an APPX user ---++ Installation/Removal First, define a new user in the APPX User file. This should NOT be an account that is also an O/S user. Assign the user a password using the 'Change Aux Password' button. Next, unzip the 'dataservices.zip' file into the $APPXPATH/services directory. Install the required Node JS modules (run this as root or an Administrator): <div style="padding-left: 30px;">npm install --loglevel=error</div> Several nodejs modules will be installed Install the APPX Data Services service instance. Replace items in <> with values of your choice, for example: <webport> = The port you want to the API to listen on.<br /> <portnumber> = The login manager port of your APPX server.<br /><appx username> = the user you defined above (not an OS user). This is the APPX user the API will log in as.<br /><appx password> = the password of the user defined in APPX<br /><appxhost> = the host name of your APPX server<br /><name> = The name you want to use for this service<br /><configuration file name> = the name of a configuration file that contains the parameters. This file is created when you remove the Data API and provides you a quick way to re-install using the previous settings The install service command: <div style="padding-left: 30px;">node servicectl.js install -p <webport> --appxhost=<hostname> --appxport=<portnumber> --appxuser=<appx username> --appxpass=<appx password></div> <br /> Examples: <div style="padding-left: 30px;">node servicectl.js install -p 3000 --appxhost=myhost --appxport=8161 --appxuser=Test --appxpass=password</div> To install from a saved configuration file: <div style="padding-left: 30px;"> </div> <div style="padding-left: 30px;">node servicectl.js install --configfilename=default-3000.json.bak</div> The remove service command: <div style="padding-left: 30px;">node servicectl.js remove --p=<webport></div> Example: <div style="padding-left: 30px;">node servicectl.js remove --p=3000</div> After installation a configuration file will be created in the 'config' subdirectory of the APPX Data Services directory. That configuration file is a JSON formatted file and will be named default-xxxxx.json where xxxxx is the <webport> number specified on the during installation. The configuration file is where you can change the parameters that where specified during the installation. Also, you can change other parameters that weren’t specified during installation such as whether to use SSL and the SSL certificate file and its key file. For example: To specify that SSL be used on the web interface set: <br />"enablessl": true<br />in the "AppConfig" section. To specify that SSL be used on the APPX login manager interface set: <br />"enablessl": true<br />in the "ProviderConfig" section. To sepcify the SSL certificate and key files for Windows set: "systemcert": "C:\\Certs\\myhost.crt",<br />"certificatepath": "C:\\Certs\\myhost.crt",<br />"privatekeypath": "C:\\Certs\\myhost.key", and for Linux set; "systemcert": "/opt/certs/myhost.crt",<br />"certificatepath": "/opt/certs/myhost.crt",<br />"privatekeypath": "/opt/certs/myhost.key", in the "AppConfig" section. After removal, the there will be a backup copy of the configuration file created in the APPX Data Services directory service with a .bak extension. This backup copy can be used for reinstallation of a APPX Data Services instance as shown above. ---++ Creating a Persistent Authentication Token For faster logins you can create a persistent authentication token that can be used in place of the appxuser and appxpassword. To create that token, run the script as shown below, after substituting <username> with the actual name of the user: <br /> node createPAT.js --username=<username> After creating the token, copy it into the APPX login manager 'tokens' directory. Then, in the configuration file, change the "ProviderConfig" section parameter as follows: "appxtoken": <token file name><br /> Next, in the "ProviderConfig" section change the following: "appxuser": "" and "appxpass": ""<br /> Finally, stop and then restart the APPX Data Services service ---++ Manually installing a new APPX Login Manager Service Instance Use the command line examples below to manually create an APPX Login Manager Service instance for APPX Data Services. These commands should be executed in the APPX login manager executable directory. Replace items in <> with values of your choice, for example:<br /> <service name> = AppxDSLoginManager -8161<br /> <service display name> = AppxDSLoginManager -8161<br /> <portnumber> = 8161<br /> <full path to appx engine executable> = for Linux: /opt/appxserver/appx | for Windows: c:\appx\Appx.exe<br /> <path to the appx data directory> = for Linux: /opt/appxserver/data | for Windows: c:\appx\data Linux:<br /> sudo ./appxLoginMgr -install -name=<service name> -displayName="<service display name>" -SockPort=<portnumber> -engine=<full path to appx engine executable> -AuthenticationMethod=Appx-User -ImpersonateGroup=NamedGroup\(appxgrp\) -ImpersonateUser=NamedUser\(appx\) -AppxProcessName=WEBSERVICES -AppxProcessType=SUBROUTINE -AppxApplication=0LA -ServiceType=data APPXPATH=<path to the appx data directory> APPX_KEYMAP=Windows<br /> Example:<br /> sudo ./appxLoginMgr -install -name=AppxDSLoginManager-8161 -displayName="AppxDSLoginManager-8161" -SockPort=8161 -engine=/opt/appxserver/appx -AuthenticationMethod=Appx-User -ImpersonateGroup=NamedGroup\(appxgrp\) -ImpersonateUser=NamedUser\(appx\) -AppxProcessName=WEBSERVICES -AppxProcessType=SUBROUTINE -AppxApplication=0LA -ServiceType=data APPXPATH=/opt/appxserver/data APPX_KEYMAP=Windows Windows:<br /> cmd /c "appxLoginMgr.exe -install -name=<service name> -displayName=<service display name> -SockPort=<portnumber> -engine=<full path to appx engine executable> -AppxApplication=0LA -AppxExecutable=c:\appx55\Appx.exe -AppxProcessName=WEBSERVICES -AppxProcessType=SUBROUTINE -AuthenticationMethod=Appx-User -ServiceType=data APPXPATH=<path to the appx data directory> APPX_KEYMAP=Windows"<br /> Example:<br /> cmd /c "appxLoginMgr.exe -install -name=AppxDSLoginManager-8161 -displayName=AppxDSLoginManager-8161 -SockPort=8161 -engine=c:\appx\Appx.exe -AppxApplication=0LA -AppxExecutable=c:\appx\Appx.exe -AppxProcessName=WEBSERVICES -AppxProcessType=SUBROUTINE -AuthenticationMethod=Appx-User -ServiceType=data APPXPATH=c:\appx\data APPX_KEYMAP=<br />Windows" ---++ Testing the APPX Data Services interface for connectivity Once installed, you can test connectivity by entering the URL's below in a web browser or by using curl (Note: curl is available by default in Windows 10 since 5/2019). To test connectivity between the browser/curl and APPX Data Services (Note: replace items in <> with the value of your host/ip):<br /> <br /> https://<myhost>/dstest (Note: will return the value OK)<br /> https://<myhost>/dsver (Note: will return the APPX Data Services version number in JSON format {i.e. {"Data Services Version":"1.0.0.20021010"}<br /> })<br /> https://<myhost>/dsdate (Note: will return the APPX Data Services service current date/time in in JSON format {i.e. {"LocalDateTime":" 02/10/202<br />0 15:43:31"},{"UtcDateTime":" 02/10/2020 20:43:31"} ))<br /> <br /> Note: If you don't have SSL enabled in the "AppConfig" section remove the 's' in https<br /> <br /> To test connectivity between the browser/curl and the APPX runtime environment via the APPX Data Services service: https://<myhost>/api/DateTest (Note: will return the APPX runtime current date/time in in JSON format {i.e. {"DateTime":"02/10/20 15:46 04"} ))<br /> https://<myhost>/api/GetApps (Note: will return the APPX runtime current date/time in in JSON format {i.e. {"id":"Application Design","label":"0AD 00<br /> - Application Design","value":"0AD"},... etc, } ) ---++ Adding Your Services ---++ <span style="background-color: transparent;">-- </span><span style="color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;">%USERSIG{JeanNeron - 2020-03-03}%</span> ---++ Comments <br />%COMMENT%
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2020-03-03
-
JeanNeron
Home
Site map
Main web
MedicaidBilling web
Sandbox web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Edit
Attach
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback