Trove/ConfigurationParameters
Contents
Overview
Configuration Parameters need to be stored in the database and have a management api.
Database Model
Name | Data Type | Length | Nullable | Details |
---|---|---|---|---|
id * | VARCHAR | 36 | False | unique id of the parameter |
name | VARCHAR | 256 | False | name of the configuration parameter |
datastore_version_id * | VARCHAR | 36 | False | datastore version id that the parameter is assigned to |
restart_required | BOOLEAN | x | False | determines if the parameter requires the datastore to be restarted |
max | INTEGER | x | True | max size of the parameter used for validation |
min | INTEGER | x | True | min size of the parameter used for validation |
data_type | VARCHAR | 256 | False | data type of the parameter |
deleted | BOOLEAN | x | False | standard field to store if parameter is deleted |
deleted_at | DATETIME | x | True | standard field to store when parameter is deleted |
{* Denotes a primary key}
{name and datastore_version_id combined should be unique to the table}
API Details
New management api calls
Calls to Create/Alter/Purge configuration parameters for each datastore version.
Verb | Resource | Description |
---|---|---|
POST | /mgmt/datastores/{datastore}/versions/{version}/parameters | Create a parameter for the given datastore version |
PUT | /mgmt/datastores/{datastore}/versions/{version}/parameters/{key} | Modify a parameter for the given datastore version |
DELETE | /mgmt/datastores/{datastore}/versions/{version}/parameters/{key} | Delete a parameter for the given datastore version |
Create or Update a parameter for the given datastore version (POST/PUT)
Request
{ "configuration-parameter": { "max_size": "1", "min_size": "100", "name": "test-1231232", "data_type": "integer", "restart_required": "1" } }
Questions
- Should the {key} be the uuid of the parameter like everything else?
- Should the {key} be the name? Every configuration parameter is unique by a combination of name and datastore version.
Existing api calls
Calls to Read the configuration parameters for each datastore do not require any change.
Verb | Resource | Description |
---|---|---|
GET | /datastores/{datastore}/versions/{version}/parameters | List all parameters for the given datastore version |
GET | /datastores/versions/{version}/parameters | Get a parameter for the given datastore version |
GET | /datastores/{datastore}/versions/{version}/parameters/{key} | List all parameters for the given datastore version |
GET | /datastores/versions/{version}/parameters/{key} | Get a parameter for the given datastore version |