Device Configuration

This module exposes device configuration.

Endpoints for these functions can be found under /api/v1/config.

POST /api/v1/config/factoryReset

Initiate the factory reset process.

PUT /api/v1/config/hostconfig

Replace the device’s host configuration.

Example request:

PUT /api/v1/config/hostconfig
Content-Type: application/json

{
  "firewall": {
    "defaults": {
      "forward": "ACCEPT",
      "input": "ACCEPT",
      "output": "ACCEPT"
    }
  },
  ...
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  change_id: 1
}

For a complete example, please see the Host Configuration section.

GET /api/v1/config/hostconfig

Get the device’s current host configuration.

Example request:

GET /api/v1/config/hostconfig

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "firewall": {
    "defaults": {
      "forward": "ACCEPT",
      "input": "ACCEPT",
      "output": "ACCEPT"
    }
  },
  ...
}

For a complete example, please see the Host Configuration section.

GET /api/v1/config/new-config

Generate a new node configuration based on the hardware.

Example request:

GET /api/v1/config/new_config

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "firewall": {
    "defaults": {
      "forward": "ACCEPT",
      "input": "ACCEPT",
      "output": "ACCEPT"
    }
  },
  ...
}

For a complete example, please see the Host Configuration section.

POST /api/v1/config/provision

Provision the device with credentials from a cloud controller.

GET /api/v1/config/provision

Get the provision status of the device.

GET /api/v1/config/settings

Get current values of system settings.

These are the values from paradrop.base.settings. Settings are loaded at system initialization from the settings.ini file and environment variables. They are intended to be read-only after initialization.

This endpoint returns the settings as a dictionary with lowercase field names.

Example: {

“portal_server_port”: 8080, …

}

GET /api/v1/config/pdconf

Get configuration sections from pdconf.

This returns a list of configuration sections and whether they were successfully applied. This is intended for debugging purposes.

PUT /api/v1/config/pdconf

Trigger pdconf to reload UCI configuration files.

Trigger pdconf to reload UCI configuration files and return the status. This function is intended for low-level debugging of the paradrop pdconf module.

GET /api/v1/config/pdid

Get the device’s current ParaDrop ID. This is the identifier assigned by the cloud controller.

Example request:

GET /api/v1/config/pdid

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  pdid: "5890e1e5ab7e317e6c6e049f"
}
POST /api/v1/config/sshKeys/(user)

Manage list of authorized keys for SSH access.

GET /api/v1/config/sshKeys/(user)

Manage list of authorized keys for SSH access.