Example
If we consider the module module-test, version 1.0 and template appliaction.properties with the following content :
spring.datasource.jndi-name=jdbc/demoKatana
overload_property={{overload_property|@comment "some other comments" @required}}
password={{password|@comment "some comments" @password}}
default={{default|@default foo}}
regular_expression={{regular_expression|@pattern t.*t}}
Calling REST service /modules/module-test/1.0/workingcopy/model, we get this :
{
"key_value_properties": [
{
"name": "regular_expression",
"comment": null,
"required": false,
"defaultValue": "",
"pattern": "t.*t",
"password": false
},
{
"name": "default",
"comment": null,
"required": false,
"defaultValue": "foo",
"pattern": "",
"password": false
},
{
"name": "password",
"comment": "some comments",
"required": false,
"defaultValue": "",
"pattern": "",
"password": true
},
{
"name": "overload_property",
"comment": "some other comments",
"required": true,
"defaultValue": "",
"pattern": "",
"password": false
}
],
"iterable_properties": []
}
When REST service is called, the class HesperidesModuleResource receive it. Then we get the module (with class ModuleAggregate) and for each file we ask to mustache to give properties (class TemplateSlurper).
Now to get properties values, as they are stored in the platform, we can call REST service /applications/MYAPPLICATION/platforms/MY-PLATFORM/properties?path=#FIRSTLEVEL#SECONDLEVEL#module-test#1.0#WORKINGCOPY :
{
"key_value_properties": [
{
"name": "overload_property",
"value": "FOO"
},
{
"name": "regular_expression",
"value": "tfgehzrgyierhgergert"
},
{
"name": "password",
"value": "{{hesperides.application.version}}"
},
{
"name": "missing",
"value": "Where am I ?"
}
],
"iterable_properties": []
}
With model and platform, we can make the connection :
- the "default" property is not valuated because it is in the model but not in the platform
- the "missing" property has been deleted in the template because the property is in the platform but not in the model