Config Management

Use the Config Management REST API to manage configurations for OpenNMS. Configurations modified will take effect instantly.

GETs (Reading Data)

Resource Description

/cm/{configName}

Returns a list of configIds in JSON/YAML format, for example, ["config1", "config2"].

200: Return: String Array

400: Return: {"MESSAGE": "<ERROR_MESSAGE>"}

/cm/schema/{configName}

Returns OpenAPI schema (for Swagger UI) in JSON/YAML format.

200: Return: OpenAPI schema

400: Return: {"MESSAGE": "<ERROR_MESSAGE>"}

/cm/{configName}/{configId}

Returns configuration in JSON/YAML format.

200: Return: Config Bean

400: Return: {"MESSAGE": "<ERROR_MESSAGE>"}

/cm/{configName}/{configId}/{path}

Returns a part of the configuration specified by configName, configId, and the path to the part in JSONPath format. Returns 404 when the configuration does not exist. Returns 400 when the path parameter has a wrong format or specifies a nonexistent path.

200 Return: part of the configuration

404 Return: {"MESSAGE": "<ERROR_MESSAGE>"}

400 Return: {"MESSAGE": "<ERROR_MESSAGE>"}

POSTs (Adding Data)

Resource Description

/cm/{configName}/{configId}

Add new configuration. If the same configuration exists, it will return an error.

200: Return nothing

400: Return: {"MESSAGE": "<ERROR_MESSAGE>"}

/cm/{configName}/{configId}/{path}

Adds an array element to the configuration part specified by configName, configId, and the path to the part in JSONPath format. Returns 404 when the configuration does not exist. Returns 400 when the path parameter has a wrong format, specifies a nonexistent path, or the provided part of the configuration has a wrong format.

200 Return: nothing

404 Return: {"MESSAGE": "<ERROR_MESSAGE>"}

400 Return: {"MESSAGE": "<ERROR_MESSAGE>"}

PUTs (Modifying Data)

Resource Description

/cm/{configName}/{configId}

Update configuration. If configuration does not exist, it will return error.

200: Return: nothing

400: Return: {"MESSAGE": "<ERROR_MESSAGE>"}

/cm/{configName}/{configId}/{path}

Updates a part of the configuration specified by configName, configId, and the path to the part in JSONPath format. Returns 404 when the configuration does not exist. Returns 400 when the path parameter has a wrong format, specifies a nonexistent path, or the provided part of the configuration has a wrong format.

200 Return: nothing

404 Return: {"MESSAGE": "<ERROR_MESSAGE>"}

400 Return: {"MESSAGE": "<ERROR_MESSAGE>"}

/cm/{configName}/{configId}/{pathToParent}/{nodeName}

Updates or inserts a part of the configuration specified by configName, configId, and the path to the parent node in JSONPath format with the node name. Returns 404 when the configuration does not exist. Returns 400 when the pathToParent parameter has a wrong format, specifies a nonexistent path, or the provided part of the configuration has a wrong format.

200 Return: nothing

404 Return: {"MESSAGE": "<ERROR_MESSAGE>"}

400 Return: {"MESSAGE": "<ERROR_MESSAGE>"}

DELETEs (Removing Data)

Resource Description

/cm/{configName}/{configId}

Delete configuration.

200: Return nothing

400: Return: {"MESSAGE": "<ERROR_MESSAGE>"}

/cm/{configName}/{configId}/{path}

Deletes a part of the configuration specified by configName, configId, and the path to the part in JSONPath format. Returns 404 when the configuration does not exist. Returns 400 when the path parameter has a wrong format, specifies a nonexistent path, or the provided part of the configuration has a wrong format.

200 Return: nothing

404 Return: {"MESSAGE": "<ERROR_MESSAGE>"}

400 Return: {"MESSAGE": "<ERROR_MESSAGE>"}