...
Open Hermod Config file.
Navigate to the top-level directory where docker-compose.yml is located. The configuration file should then be found in a config/ directory.
Example: File structure
Code Block mydir/ |-- cacerts |-- certificates |-- config | |-- application.yml -> cod-hermod.yml | `-- cod-hermod.yml `-- docker-compose.yml
Open the configuration file for editing.
Example: Command to edit configuration file
Code Block language text vi config/cod-hermod.yml
Application.yml is a link to cod-hermod.yml.
Application.yml is the actual file used by the server.
...
Navigate to and open for editing application.yml.
Default file path: /wbapps/hermod/WEB-INF/classes/application.ymlOpen a browser and go to the following URL, using a unique
<myclientid>
:Example: Generate client URL
Code Block language text http://localhost:20400/<contextPath>/<uriBase>/util/generateclient/<myclientid> The default value for /<contextPath>/<uriBase> is /hermod/rest
Find port numberAll requests below are triggered from the host itself, thus localhost is used.
The port number (20400 in the example above) might have been assigned a different value. To find out the current port number, do the following:
- For docker: type
Type the command:Code Block docker ps | grep hermod_hermod
- For tomcat: check
Check server.xmlCopy the content from the resulting web page and paste it into the
allowed-clients
section of the configuration file.
...
Refresh the configuration:
Example: Refresh configuration
Code Block language text curl -X POST http://localhost:20400/<contextPath>/refresh
Test the new key by sending a request using curl (set
THE-NEW-KEY
below):
Example: Test API keyCode Block curl -w%{http_code} -X POST \ http://localhost:20400/<contextPath>/<uriBase>/command/ping \ -H 'cache-control: no-cache' \ -H 'content-type: application/json' \ -H 'x-api-key: THE-NEW-KEY' \ -d '{ "commandHeader" : { "to": ["api-test"] } }'
Check the response.
If you get a 403 response, you have the wrong API key.
If you get a 404 response, then you have the correct API key. A 404 response means that the user
api-test
isn't found, which is expected at this point.