Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor formatting update

...

  1. Open Hermod Config file. 

  2. 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
  3. Open the configuration file for editing.

    Example: Command to edit configuration file

    Code Block
    languagetext
    vi config/cod-hermod.yml

Application.yml is a link to cod-hermod.yml
Application.yml is the actual file used by the server. 

...

  1. Navigate to and open for editing application.yml.
    Default file path: /wbapps/hermod/WEB-INF/classes/application.yml 

  2. Open a browser and go to the following URL, using a unique <myclientid>:

    Example: Generate client URL

    Code Block
    languagetext
    http://localhost:20400/<contextPath>/<uriBase>/util/generateclient/<myclientid>
    
    The default value for /<contextPath>/<uriBase> is /hermod/rest


    Find port number

    All 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.xml

  3. Copy the content from the resulting web page and paste it into the allowed-clients section of the configuration file. 

...

  1. Refresh the configuration:

    Example: Refresh configuration

    Code Block
    languagetext
    curl -X POST http://localhost:20400/<contextPath>/refresh
  2. Test the new key by sending a request using curl (set THE-NEW-KEY below):

    Example: Test API key

    Code 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"]
      }
    }'
  3. 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.