Skip to content

Working with the Management System API

Users that are not familiar with how to work with APIs can find pointers here. This section covers how to generate client source code and basic steps on using calls and functions of the Management System API.

Note

The API documentation file uses trynerve1.nerve.cloud as the Management System. Other Management Systems will not allow the use of the "Try it out"-feature of the web-based Swagger Editor, as cross-origin resource sharing is deactivated for security reasons. Therefore, in order to try out the API from within the Swagger Editor, request a free trial for access to trynerve1.nerve.cloud or contact support through the TTTech Industrial support portal.

In order to use the "Try it out"-feature from the Swagger Editor on other Management Systems, contact support through the TTTech Industrial support portal, as Nerve service technicians need to configure the Management System first.

Generating client source code from the OpenAPI file

To easily generate a workable client that enables working with the Management System API according to the OpenAPI standard, follow the instructions below. While there are many other tools for generation, it is highly recommended to use the Swagger Editor.

  1. Right-click and save as management_system_api.json in the Swagger UI on the Management System API page.

    Download JSON

  2. Go to Swagger Editor.

  3. Select File > Import file in the navigation bar.

    Import file

  4. Open the management_system_api.json that was downloaded before. It takes Swagger Editor a couple of seconds to generate the result.

  5. Select Generate Client in the navigation bar.
  6. Select a language from the list.

    Generate client language

After a couple of seconds, a download will start for a ZIP file containing the generated client.

Trying out the Management System API

To try out the API in the Swagger Editor, a Management System and a user account in this Management System are required. Note that the user account needs admin permissions to use certain calls and functions. In case of no Management System being available, write an issue through the TTTech Industrial support portal.

Note

The API documentation file uses trynerve1.nerve.cloud as the Management System. Other Management Systems will not allow the use of the "Try it out"-feature of the web-based Swagger Editor, as cross-origin resource sharing is deactivated for security reasons. Therefore, in order to try out the API from within the Swagger Editor, request a free trial for access to trynerve1.nerve.cloud or contact support through the TTTech Industrial support portal.

In order to use the "Try it out"-feature from the Swagger Editor on other Management Systems, contact support through the TTTech Industrial support portal, as Nerve service technicians need to configure the Management System first.

  1. Right-click and save as management_system_api.json in the Swagger UI on the Management System API page.

    Download JSON

  2. Go to Swagger Editor.

  3. Select File > Import file in the navigation bar.

    Import file

  4. Open the management_system_api.json that was downloaded before. It takes Swagger Editor a couple of seconds to generate the result.

    Note

    When using other Management Systems than trynerve1.nerve.cloud, replace the Management System URL in the following lines:

    12
    13
    14
    15
    16
    "servers": [
      {
        "url": "<managementsystemURL>"
      }
    ],
    

    The drop-down menu in the generated output on the right side will show the URL of the new Management System.

    Enter server URL

    Make sure to contact support through the TTTech Industrial support portal, as Nerve service technicians need to configure the Management System first for this to work.

  5. Expand POST /auth/login under USER on the right side.

  6. Select Try it out.

    Try user login

  7. Select the text field.

  8. Enter the following information:

    Item Description
    identity Enter the user name of the account used to log in to the Management System.
    secret Enter the password of the account used to log in to the Managment System.

    Enter user account information

  9. Select Execute. A response from the server will pop up below the Execute button.

  10. Look for sessionId in the Response Body of the server response.

    Copy sessionId

  11. Copy the value next to sessionId.

    Note

    Take note to only copy the numeric value without quotation marks.

  12. Select Authorize at the top of the screen. A new window will appear.

    Select Authorize

  13. Paste the session ID value into the Value field under sessionId (apiKey).

    Paste session ID value

  14. Select Authorize.

  15. Select Close to close the window.

The user is now authenticated and successfully logged in. Functions can now be experimented with. As a demonstration, follow the instructions below to fetch a list of Docker workloads provisioned in the Management System.

  1. Expand GET /nerve/v3/workloads under WORKLOAD_v3.

    Expand GET /nerve/v3/workloads

  2. Select Try it out.

  3. Select the drop-down menu next to fType string (query).
  4. Select docker from the drop-down menu.

    Select docker

  5. Select Execute.

    Select Execute

A response from the server will pop up below the Execute button, presenting a list of Docker workloads available in the Management System.

Check server response