Page History

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This document defines the usage of the Configureme repository RESTful interface.

 

General

Request format

Requests to the REST Interface should have the form:

...

Parameter 
serverName of the server, for example localhost or www.mydomain.com
portPort of the server. For example 8088.
restpathThe specific url for the case. The url is defined in the table below.

 

Response format

The response provided as JSON. The response format is defined by Accept header.

...

  • Status - could the request be processed correctly. If the status is false you should throw away the response.
  • Results - a dictionary (hashmap) with result objects. The result objects differ from case to case. 

Cases

 

SectionCaseCase-URLMethodParametersExample URLResponse 
Configurations       
 List all configurations names/configurationsGET 
Code Block
http://<server>:<port>:<app>/configurations
Code Block
 
 
 Get a single configuration/configurations/{name}GET
  • name - configuration name
Code Block
http://<server>:<port>:<app>/convigurations/test1
Code Block
languagejs
 
 
 Delete configuration/configurations/{name}DELETE
  • name - configuration name
Code Block
http://<server>:<port>:<app>/configurations/test1

none.

Example:

Code Block
languagejs
{
  "success": true,
  "message": null,
  "results": {
    "test2": "Configuration deleted"
  }
}
Warning, this will actually drop data.
 Create configuration/configurations/{name}POST, PUT

POST/PUT data JSON:

{
 "name": "TestAccumulator",
 "producerId": "ThreadCount", 
 "interval": "1m",
 "unit": "MILLISECONDS",
 "statName": "ThreadCount",
 "valueName": "current"
}
Code Block
http://<server>:<port>/<app>/configurations/test3
Code Block
{
  "success": true,
  "message": null,
  "results": {
    "test3": {
      "id": "57342ff7b4c36d4f97ed067e",
      "name": "test3",
      "creationTimestamp": 1463037943620,
      "lastEditTimestamp": 1463037943620,
      "configurationContext": {
        "name": "TestAccumulator",
        "producerId": "ThreadCount",
        "interval": "1m",
        "unit": "MILLISECONDS",
        "statName": "ThreadCount",
        "valueName": "current"
      }
    }
  }
}
Note, if the name is already used, it will be replaced. 
 Returns timestamp of last change/lastChangeTimestampGET 
Code Block
http://<server>:<port>:<app>/lastChangeTimestamp/test1
Code Block
 
 
 Return configuration for environment/configurations/{name}/{environment}GET

name - configuration name

evironment - specified environment

Code Block
http://<server>:<port>/<app>//configurations/test1/test
 
Code Block
{
    "success": true,
    "results": {
        "version": {
            "fileTimestamp": "2015-06-28T00:25:50,000",
            "version": "2.6.2-SNAPSHOT",
            "group": "net.anotheria",
            "artifact": "moskito-webui"
        }
    }
}