Difference between revisions of "Trove/ConfigurationParameters"
(→Create or Update a parameter for the given datastore version (POST/PUT)) |
|||
(8 intermediate revisions by the same user not shown) | |||
Line 11: | Line 11: | ||
|- | |- | ||
| name || VARCHAR || 256 || False || name of the configuration parameter | | name || VARCHAR || 256 || False || name of the configuration parameter | ||
+ | |- | ||
+ | | description || VARCHAR || 256 || False || friendly description of the configuration parameter | ||
|- | |- | ||
| datastore_version_id * || VARCHAR || 36 || False || datastore version id that the parameter is assigned to | | datastore_version_id * || VARCHAR || 36 || False || datastore version id that the parameter is assigned to | ||
Line 28: | Line 30: | ||
{* Denotes a primary key} | {* Denotes a primary key} | ||
+ | |||
+ | {name and datastore_version_id combined should be unique to the table} | ||
== API Details == | == API Details == | ||
Line 53: | Line 57: | ||
"max_size": "1", | "max_size": "1", | ||
"min_size": "100", | "min_size": "100", | ||
+ | "description": "A friendly description for the configuration parameter.", | ||
"name": "test-1231232", | "name": "test-1231232", | ||
"data_type": "integer", | "data_type": "integer", | ||
Line 80: | Line 85: | ||
| GET || /datastores/versions/{version}/parameters/{key} || Get a parameter for the given datastore version | | GET || /datastores/versions/{version}/parameters/{key} || Get a parameter for the given datastore version | ||
|} | |} | ||
+ | |||
+ | == trove-manage Command Additions == | ||
+ | |||
+ | In order to insert many configuration parameters (say 20 or more) into the database for a datastore version, we need a way of importing the list from the trove-manage command. This should not preclude the ability of adding or deleting parameters from the database as well for a datastore version. | ||
+ | |||
+ | === Add configuration import command === | ||
+ | |||
+ | '''trove-manage load_datastore_config_parameters datastore_version_uuid /path/to/file/to/import''' | ||
+ | |||
+ | This command will allow you to import the existing configuration parameters that are specified in the template file so that it is easier to load them. | ||
+ | |||
+ | === if trove-manage categories are available === | ||
+ | |||
+ | This will be similar but it can be shortened. | ||
+ | |||
+ | '''trove-manage configuration_parameters import datastore_version_uuid /path/to/file/to/import''' |
Latest revision as of 21:49, 8 April 2014
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 |
description | VARCHAR | 256 | False | friendly description 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", "description": "A friendly description for the configuration parameter.", "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 |
trove-manage Command Additions
In order to insert many configuration parameters (say 20 or more) into the database for a datastore version, we need a way of importing the list from the trove-manage command. This should not preclude the ability of adding or deleting parameters from the database as well for a datastore version.
Add configuration import command
trove-manage load_datastore_config_parameters datastore_version_uuid /path/to/file/to/import
This command will allow you to import the existing configuration parameters that are specified in the template file so that it is easier to load them.
if trove-manage categories are available
This will be similar but it can be shortened.
trove-manage configuration_parameters import datastore_version_uuid /path/to/file/to/import