Skip to main content

Saving Configurations

Last updated: 15-Oct-2020
Rate this article:

The Automatic Service

By nature, no state or configuration is stored when a machine starts up. Instead of having to call each service manually on boot, the automatic service will apply your configuration for you (hence the name!)

This is used to make settings "permanent", such as ensuring the rotation of a monitor and touch calibration after a reboot.

:info: Note

Network connection settings are persisted independently. See network.proto for more details.

When the Platform starts, the Apply is called using the Configuration message that was previously passed to the Store. It is also possible to manually use the Apply at any other time. The automatic configuration is NOT applied every time an application starts. It is only after the Platform is restarted, which is normally only after a reboot.

Instead of creating the Configuration message by hand, it is recommended that all of the configuration for each other service is prepared at once and then the Generate is used to create a Configuration message that would match the prepared state. Then that message can be passed to the Store. This is essentially a "Save Configuration" flow.

If there is an error in any of the configuration requests, then the Apply will stop executing at that point. When the cause of the issue is fixed, such as if a missing hardware component was reconnected, then the Apply endpoint can be called again to retry the automatic configuration.

Generate

Creates a Configuration message that, when sent to the Store, would lead to automatic configuration resulting in the same settings that are in place when Generate was called

GET Request

http://{{dashboardHost}}/api/{{dashboardVersion}}/machine/{{dashboardMachine}}/automatic/generate

Example Response

{
  "audio": [],
  "display": [
    {
      "display_id": "DP1",
      "configuration": {
        "enabled": false,
        "mode": "",
        "reflect": "NO_REFLECT",
        "rotate": "NO_ROTATE",
        "transform": ""
      }
    },
    {
      "display_id": "DP2",
      "configuration": {
        "enabled": true,
        "mode": "1920x1080@60.00",
        "reflect": "NO_REFLECT",
        "rotate": "NO_ROTATE",
        "transform": ""
      }
    },
    {
      "display_id": "VIRTUAL1",
      "configuration": {
        "enabled": false,
        "mode": "",
        "reflect": "NO_REFLECT",
        "rotate": "NO_ROTATE",
        "transform": ""
      }
    }
  ],
  "touch": [
    {
      "touch_device_id": "Elo_Touch_Solutions_E801039_Edgley",
      "configuration": {
        "calibration": "",
        "orientation": "FORWARD_UPRIGHT"
      }
    }
  ],
  "displayGlobal": {
    "dpi": 96
  }
}

Think of this as a snapshot of the current settings

Store

Now you can POST the Generate response body to Store which will be applied on Reboot or you can use the Apply to save it now.

POST Request

http://{{dashboardHost}}/api/{{dashboardVersion}}/machine/{{dashboardMachine}}/automatic/store

POST Body

{
  "audio": [],
  "display": [
    {
      "display_id": "DP1",
      "configuration": {
        "enabled": false,
        "mode": "",
        "reflect": "NO_REFLECT",
        "rotate": "NO_ROTATE",
        "transform": ""
      }
    },
    {
      "display_id": "DP2",
      "configuration": {
        "enabled": true,
        "mode": "1920x1080@60.00",
        "reflect": "NO_REFLECT",
        "rotate": "NO_ROTATE",
        "transform": ""
      }
    },
    {
      "display_id": "VIRTUAL1",
      "configuration": {
        "enabled": false,
        "mode": "",
        "reflect": "NO_REFLECT",
        "rotate": "NO_ROTATE",
        "transform": ""
      }
    }
  ],
  "touch": [
    {
      "touch_device_id": "Elo_Touch_Solutions_E801039_Edgley",
      "configuration": {
        "calibration": "",
        "orientation": "FORWARD_UPRIGHT"
      }
    }
  ],
  "displayGlobal": {
    "dpi": 96
  }
}

Apply

Apply uses the stored Configuration message to apply settings for each individual service

http://{{dashboardHost}}/api/{{dashboardVersion}}/machine/{{dashboardMachine}}/automatic/apply

View

Exposes the currently stored Configuration

http://{{dashboardHost}}/api/{{dashboardVersion}}/machine/{{dashboardMachine}}/automatic/view

Clear

Erases the currently stored Configuration so that no automatic configuration will be done on next Platform start-up.

http://{{dashboardHost}}/api/{{dashboardVersion}}/machine/{{dashboardMachine}}/automatic/clear
Rate this article:
Logo of Verifone