Installing the HTTP API
There are two main ways to host the PowerTSM HTTP API on-premises:
- Running the service directly
- Running the service within a Docker container
Running the Service Directly
Section titled “Running the Service Directly”Prerequisites
Section titled “Prerequisites”In order to run the service, make sure that .NET is installed on the system: System Requirements.
Installation
Section titled “Installation”-
Locate the
TSM HTTP APIfolder within the distributed zip file. This contains a folderBinaries/Framework Dependent. -
Extract the contents of this folder to a location of choice.
-
Open the folder using a command prompt. On Microsoft Windows, use either
powershell.exeorcmd.exe. On Linux, any available shell will do. -
Start the service. The folder contains two files that can be used to start the service:
HAKOM.TSM.Http.exeHAKOM.TSM.Http.dll
The former can be used on Windows only. The latter can be used on any system that supports .NET 8.
Execute
HAKOM.TSM.Http.exe.Execute
dotnet HAKOM.TSM.Http.dll.
Running the Service in the Background
Section titled “Running the Service in the Background”In practice, the service can be run in the background instead of from a command prompt.
By adding a -s or --runAsService command line parameter when starting the HTTP API, the service will now allow being run in background.
A service can be created in Windows using:
sc.exe create "Your service name" binPath= "<path-to-http-api-bin-folder>/HAKOM.TSM.Http.exe -s" start= autoUnder Linux (using systemd), create an appropriate .service file under /etc/systemd/system, for example your-service-name.service:
[Unit]Description=Your service name[Service]Type=notifyExecStart=<path-to-dotnet>/dotnet <path-to-http-api-bin-folder>/HAKOM.TSM.Http.dll -s[Install]WantedBy=multi-user.targetand reload the service using:
sudo systemctl daemon-reloadRunning the Service Within a Docker Container
Section titled “Running the Service Within a Docker Container”Prerequisites
Section titled “Prerequisites”In order to run the service within a Docker container, the host has to have Docker installed.
Installation
Section titled “Installation”-
Locate the
TSM HTTP APIfolder within the distributed zip file. This contains a folderDocker. -
Extract the contents of this folder to a location of choice.
-
Open the folder using a command prompt. On Microsoft Windows, use either
powershell.exeorcmd.exe. On Linux, any available shell will do. -
Execute the following command:
docker load --input HAKOM.TSM.Http_4.13.0.tar
Customizing the Docker Image
Section titled “Customizing the Docker Image”In order to customize the Docker image (e.g., to include additional configuration files or libraries for extending the service’s functionality), extract the entire contents of the TSM HTTP API folder from the distributed zip file to the host.
Modify Docker/Dockerfile as needed.
Open the extracted folder in a command prompt and run:
docker build -f ./Docker/Dockerfile -t hakom.tsm.http:4.13.0 .