/config/db

The database configuration.

Get /config/db

SecurityApiKey
Request
query Parameters
max-depth
integer >= 1

Limit output depth of the response. See Max-Depth.

Example: max-depth=2
filter
string

Response filter string. See Filter-Spec.

Example: filter={foo,bar}
Responses
200

Normal response.

401

Unauthorized response.

get/config/db
Request samples
Response samples
application/json
{
  • "result": {
    },
  • "error": "Error message (present if an error occurred)."
}

Replace /config/db

SecurityApiKey
Request
Request Body schema: application/json
epoch
string (configDbEpoch)

The time when the meter started recording data. This is a decimal Unix timestamp string.

The relevance of this resource is that other services in this API by default return accumulated register values relative to this time so that, at the time of the epoch, they all read 0. Changing this value therefore changes the values reported by those services. Similarly, user interfaces that use this API generally do not present data before the epoch, effectively providing a limit to the history visible to the user.

Writing this resource does not change the data stored in the database. In other words, the epoch generally can freely be moved forward or backward in time. The only constraint is that the new epoch does have to be within the time range covered by the database. If a future time is specified, it will automatically be capped to the time of the most recent row in the database. If a time is specified that is older than the oldest row in the database, an error object is returned. If this error occurs, check the device time (/sys/time) and database configuration (/sys/db) to confirm that they have the expected values.

Responses
200

Normal response.

401

Unauthorized response.

put/config/db
Request samples
application/json
{ }
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}

Update /config/db

SecurityApiKey
Request
Request Body schema: application/json
epoch
string (configDbEpoch)

The time when the meter started recording data. This is a decimal Unix timestamp string.

The relevance of this resource is that other services in this API by default return accumulated register values relative to this time so that, at the time of the epoch, they all read 0. Changing this value therefore changes the values reported by those services. Similarly, user interfaces that use this API generally do not present data before the epoch, effectively providing a limit to the history visible to the user.

Writing this resource does not change the data stored in the database. In other words, the epoch generally can freely be moved forward or backward in time. The only constraint is that the new epoch does have to be within the time range covered by the database. If a future time is specified, it will automatically be capped to the time of the most recent row in the database. If a time is specified that is older than the oldest row in the database, an error object is returned. If this error occurs, check the device time (/sys/time) and database configuration (/sys/db) to confirm that they have the expected values.

Responses
200

Normal response.

401

Unauthorized response.

post/config/db
Request samples
application/json
{ }
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}

Delete /config/db

Reset to default. See the descriptions of the individual endpoints for their default values. Commonly, arrays and strings are cleared to empty, numbers are cleared to 0, and booleans are cleared to false.

SecurityApiKey
Responses
200

Normal response.

401

Unauthorized response.

delete/config/db
Request samples
Response samples
application/json
{
  • "status": "OK",
  • "error": "Error message (present if an error occurred)."
}