Retrieves the list of all configurations currently stored in the Config Server.
Returns:
- Http status 200 on success, with the list of stored configurations in the response body.
- Http status 500 on generic error, with an error message in the response body.
None.
curl --location --request GET 'http://localhost:8080/'
[
{
"id": "test2",
"name": "Test Configuration 2",
"value": "test-2"
},
{
"id": "test1",
"name": "Test Configuration 1",
"value": "test-1"
}
]
Response item | Description | Data type |
---|---|---|
id | A unique identifier of the configuration. | String |
name | A human-readable name or description of the configuration. | String |
value | The value of the configuration. | String |
{
"error": "Error retrieving configuration list. Caused by: Unable to get configuration list."
}
Creates a new configuration with the ID provided in the URL and the data provided in the request body.
Returns:
- Http status 201 on success, with the newly created configuration in the response body.
- Http status 400 on invalid data (empty strings for name or value attributes), with an error message in the response body.
- Http status 409 on an invalid id (already in use), with an error message in the response body.
- Http status 500 on generic error, with an error message in the response body.
Path parameter | Description |
---|---|
id | The identifier for the configuration you want to create. |
curl --location --request POST 'http://localhost:8080/test1' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Test Configuration 1",
"value": "test-1"
}'
{
"id": "test1",
"name": "Test Configuration 1",
"value": "test-1"
}
Response item | Description | Data type |
---|---|---|
id | A unique identifier of the configuration. | String |
name | A human-readable name or description of the configuration. | String |
value | The value of the configuration. | String |
{
"error": "Submitted configuration parameters are not valid."
}
Retrieves the configuration data for the specified id.
Returns:
- Http status 200 on success, with the requested configuration in the response body.
- Http status 404 on configuration not found, with an error message in the response body.
Path parameter | Description |
---|---|
id | The identifier for the configuration you want to retrieve. |
curl --location --request GET 'http://localhost:8080/test1'
{
"id": "test1",
"name": "Test Configuration 1",
"value": "test-1"
}
Response item | Description | Data type |
---|---|---|
id | A unique identifier of the configuration. | String |
name | A human-readable name or description of the configuration. | String |
value | The value of the configuration. | String |
{
"error": "Error retrieving configuration. Caused by: No existing configuration for ID testX."
}
Updates the configuration data for the specified id with the new information provided in the request body.
Returns:
- Http status 200 on success, with the updated configuration in the response body.
- Http status 400 on invalid data (empty strings for name or value attributes), with an error message in the response body.
- Http status 404 on configuration not found, with an error message in the response body.
- Http status 500 on generic error, with an error message in the response body.
Path parameter | Description |
---|---|
id | The identifier for the configuration you want to update. |
curl --location --request PUT 'http://localhost:8080/test1' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Configurazione Test 1",
"value": "test-1-a"
}'
{
"id": "test1",
"name": "Configurazione Test 1",
"value": "test-1-a"
}
Response item | Description | Data type |
---|---|---|
id | A unique identifier of the configuration. | String |
name | A human-readable name or description of the configuration. | String |
value | The value of the configuration. | String |
{
"error": "Error updating configuration. Caused by: No existing configuration for ID testX."
}
Deletes the configuration data for the specified id.
Returns:
- Http status 200 on success, with the deleted configuration in the response body.
- Http status 404 on configuration not found, with an error message in the response body.
- Http status 500 on generic error, with an error message in the response body.
Path parameter | Description |
---|---|
id | The identifier for the configuration you want to delete. |
curl --location --request DELETE 'http://localhost:8080/test1'
{
"id": "test1",
"name": "Configurazione Test 1",
"value": "test-1"
}
Response item | Description | Data type |
---|---|---|
id | A unique identifier of the configuration. | String |
name | A human-readable name or description of the configuration. | String |
value | The value of the configuration. | String |
{
"error": "Error deleting configuration. Caused by: No existing configuration for ID testX."
}