Configuring Swagger🔗

Note

Starting with Eocortex version 4.2, the Swagger tool for viewing and executing queries has become available.

By default, browser viewing of the Swagger web interface is not available for the distribution being installed.

To configure the Swagger display, follow these steps:

Configuring on Windows OS🔗

  1. Create a file named DebugParams.xml in a system folder. For example, in the folder C:\Windows\Temp.

    Warning

    Access to the folder must not be restricted for the user.

  2. Open the DebugParams.xml file and add the following line to enable the Swagger display option:

    <DisableWebApiSwagger>false</DisableWebApiSwagger>.
    

    Example of writing to the DebugParams.xml file:

    <?xml version="1.0"?>
    <DebugParams xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <DebugServerParams>
            <DisableWebApiSwagger>false</DisableWebApiSwagger>
        </DebugServerParams>
    </DebugParams>
    

    Save the changes.

  3. Move the created file to the C:\Program Files\Eocortex Server folder.

  4. Restart the Eocortex Server application.

  5. Open Swagger at http://host:port/webapi/swagger/index.html.

Configuring on Linux OS🔗

  1. Stop the Eocortex Server application:

    sudo systemctl stop eocortex
    
  2. Create the DebugParams.xml file in the /opt/EocortexServer folder using the command:

    sudo touch /opt/EocortexServer/DebugParams.xml
    
  3. Open the DebugParams.xml file and add the following line to enable the Swagger display option:

    <DisableWebApiSwagger>false</DisableWebApiSwagger>.
    

    Example of writing to the DebugParams.xml file:

    <?xml version="1.0"?>
    <DebugParams xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <DebugServerParams>
            <DisableWebApiSwagger>false</DisableWebApiSwagger>
        </DebugServerParams>
    </DebugParams>
    

    Save the changes.

  4. Start the Eocortex Server application back:

    sudo systemctl start eocortex
    
  5. Open Swagger at http://host:port/webapi/swagger/index.html.

Authorization🔗

To authorize in Swagger, click on the Authorize button on the right side of the screen.

../_images/swagger-ui.png

The Swagger web interface supports the following authorization methods:

../_images/swagger-ui-authorization.png
  • Bearer

    Authorization header (Bearer token)

  • Basic

    Authorization header (Basic login:password)

Features of the Swagger interface🔗

  • Doesn't support passing authorization data through URLs.

  • Doesn't support authorization through Active Directory.

Note

The queries described in the Swagger documentation support the specified authorization methods.