![]() |
Zentitle SDK and Library
|
The Nalpeiron Python SDK has been written for Python v3. The Nalpeiron library completely functions in Python v2 but the example scripts in the SDK will need to be modified to run in v2.
This SDK contains a Python example of a java wrapper to access the Nalpeiron C library.
The basic structure of the example is:
Main Dir- cshafer.py - File containing wrapper for generic C functions cnsl.py - File containing wrapper for C licensing functions cnsa.py - File containing wrapper for C analytics functions cpsl.py - File containing wrapper for C passive licensing functions pnilm.py - Python 3 script for accessing the library's functions from the command line pnsaTest.py - Python 3 script demonstrating access and testing of the analytics functions shaferExample.py- Python 3 script demonstrating usage of library licensing and analytics nslTerm.py - Python 3 script demonstrating account base licensing and the RPC call. pslTerm.py - Python 3 script demonstrating usage of the passive licensing library. Script uses ANSI escape seq to move cursor. May not display properly on version of Windows prior to Win10. nalpParse.py - Simply Python 3 module to aid in entering parametes from the command line. libShafer.so OR libShafer.dylib OR Shafer.dll you must use a copy of your stamped library in ALL the demo scripts. Use can use the `--`Library /path/to/libShafer.so command line parameter to point the scripts to the library.
More information is available on pnilm and pnsaTEst are available at:
shaferExample.py
python3 ./shaferExample.py --
Library /tmp/test30.so --
WorkDir /tmp --
Auth1 10 --
Auth2 20 --
Auth3 30 --
NSLEnable 1 --
NSAEnable 1 --
CustomerID 3183 --
ProductID 100 --
Username testname --
FeatureCode FEAT5 --
LicenseCode 728304469661484484
pnsaTest.py
python3 pnsaTest.py --
Library /tmp/test30.so --
WorkDir /tmp --
NSLEnable 1 --
NSAEnable 1 --
CustomerID 3183 --
ProductID 100 --
Auth1 10 --
Auth2 20 --
Auth3 30 --
FeatureCode FEAT5 --
Username testuser --
noLoops 10
nslTerm.py
**python3 ./nslTerm.py --
Library /tmp/simon.so --
WorkDir /tmp --
NSLEnable 1 --
CustomerID 3183 --
ProductID 100 --
Auth1 10 --
Auth2 20 --
Auth3 30
pslTerm.py
python3 ./pslTerm.py --
Library /tmp/simon.so --
CustomerID 3183 --
ProductID 100 --
Auth1 10 --
Auth2 20 --
Auth3 30 --
LicenseCode atestClientID21 --
PSLContainer /tmp/atestClientID21.txt
NSLGetHostName
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLGetHostName
The hostname of the licensing server ismy.nalpeiron.com
NSLGetVersion
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLGetVersion
Version: Library Version: 3.3.154.0 NSL: 13.3.154.0
NSLTestConnection2
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLTestConnection2
Connection Successful
NSLGetComputerID
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLGetComputerID
The computer ID is: 9obLT/+KhgvwNrPgvgPZ
NSLGetLicenseStatus
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLGetLicenseStatus
License status is: 1
NSLGetLibraryOptions
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLGetLibraryOptions
Library options are 15
The return value is a bit field consisting of on/off information for library creation options:
BIT MEANING
0 Reserved
1 NSA Privacy enabled
2 VM detection
3 HDSN
4 Reserved
5 HTTPS
15 in the above example would correspond to NSA privacy enabled, VM detection enabled, and HDSN enabled.
NSLGetLicense
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLGetLicense --
LicenseCode 318304469661484484
License status is 1
NSLGetLicenseInfo
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLGetLicenseInfo
License type is 3 and activation type is 1
NSLGetVMInfo
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLGetVMInfo
The library is NOT running on a virtual machine Dectection routines say DetectionDisabled
NSLGetLeaseExpSec
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLGetLeaseExpSec
The Lease Expiration is at 1531488617 which is in 43197 sec
NSLGetLeaseExpDate
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLGetLeaseExpDate
The Lease Expiration Date is Fri Jul 13 08:30:17 2018
NSLGetLicenseStatus
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLGetLicenseStatus
License status is: 1
NSLGeAvailProcesses
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLGetAvailProcesses
There are a maximum of 0 allowed. 1 of these are available for use.
NSLGetFeatureStatus
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 --
FeatureCode FEAT1 NSLGetFeatureStatus
FEAT1 has expired
NSLCheckoutFeature
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 --
FeatureCode FEAT6 --
LicenseCode 318304469661484484 NSLCheckoutFeature
FEAT6 is valid
NSLGetFeatureStatus
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 --
FeatureCode FEAT6 NSLGetFeatureStatus
FEAT6 is valid
NSLReturnFeature
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLReturnFeature --
FeatureCode FEAT6 --
LicenseCode 318304469661484484
FEAT6 returned
NSLGetUDFValue
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 --
FeatureCode TEST1 NSLGetUDF
UDF: null
NSLGetPoolInfo
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 --
FeatureCode FEAT7 NSLGetPoolInfo
FEAT7 is valid with 0 elements of 1000 maximum
NSLCheckoutPool
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 --
LicenseCode 318304469661484484 --
FeatureCode FEAT7 --
PoolAmount 50 NSLCheckoutPool
FEAT7 success
NSLGetPoolInfo
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 --
FeatureCode FEAT7 NSLGetPoolInfo
FEAT7 is valid with 50 elements of 1000 maximum
NSLReturnPool
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 --
LicenseCode 318304469661484484 --
FeatureCode FEAT7 --
PoolAmount 20 NSLReturnPool
FEAT7 success
NSLGetPoolInfo python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 --
FeatureCode FEAT7 NSLGetPoolInfo
FEAT7 is valid with 30 elements of 1000 maximum
NSLReturnPool python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 --
FeatureCode FEAT7 NSLReturnPoolInfo
FEAT7 success
NSLGetPoolInfo python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 --
FeatureCode FEAT7 NSLGetPoolInfo
FEAT7 is valid with 0 elements of 1000 maximum
NSLReturnLicense
python3 ./pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSLEnable 1 --
Auth1 10 --
Auth2 20 --
Auth3 30 NSLReturnLicense --
LicenseCode 318304469661484484
License status is -6
GetErrorMessage
**python3 pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp --
NSAEnable 1 --
NSLEnable 1 --
NalpErrorNo -1096 GetErrorMessage
NSATestConnection2
python3 pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp/test --
NSAEnable 1 --
NSATestConnection2
NOTE No response unless an error occurs
NSAGetPrivacy
python3 pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp/test --
NSAEnable 1 --
NSAGetPrivacy
Privacy is 1
NSASetPrivacy
python3 pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp/test --
NSAEnable 1 --
NSAGetPrivacy --
NSAPrivacy 0
NOTE No response unless an error occurs
NSAGetComputerID
python3 pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp/test --
NSAEnable 1 --
NSAGetComputerID
The computer ID is: RXbew8g59J//1nTZkCDi
NSAGetHostName
python3 pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp/test --
NSAEnable 1 --
NSAGetHostName
Hostname is my.nalpeiron.com
NSAGetVersion
python3 pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp/test --
NSAEnable 1 --
NSAGetVersion
Version Library Version: 3.2.82.0 NSA: 3.2.82.0
NSAGetStats
python3 pnilm.py --
Library /tmp/test30.so --
LogLevel 4 --
WorkDir /tmp/test --
NSAEnable 1 --
NSAGetStats