User story #1246
closed
Policy Configuration: multivalued section within multivalues sections
Added by Jonathan CLARKE over 13 years ago.
Updated almost 3 years ago.
Category:
Web - Config management
Description
I would like to be able to have multi-valued variables in multi-valued sections. In this example, that would be for each command, allow several users, and on a higher level, allow several commands.
Technical precisions: we want to have a Policy.xml like:
<SECTIONS>
<SECTION name="SX" component="true" />
<SECTION name="SA" multivalued="true">
<INPUT name="iA" />
<INPUT name="iB" />
<SECTION name="SB" multivalued="true">
<input name="iC" />
</SECTION>
</SECTION>
<SECTION name="SC">
<input name="iC" />
</SECTION>
</SECTIONS>
And be able to use following values (with format: "#section name : iteration" and "variable name : value"
- PI-CR-SERIAL-1:
- #SA : SA1
- iA : iA1
- iB : iB1
- #SB : SB1
- #SB : SB2
- #SA : SA2
- iA : iA2
- iB : iB3
- #SB : SB3
- #SC : SC1
- PI-CR-SERIAL-2:
- #SA : SA3
- iA : iA3
- iB : iB3
- #SB : SB4
- #SC : SC2
- Category changed from 14 to 9
- Subject changed from Policy Configuration: multivalued variables within multivalues sections to Policy Configuration: multivalued section within multivalues sections
- Assignee set to François ARMAND
- Priority changed from N/A to 1 (highest)
- Target version changed from 10 to 17
- Description updated (diff)
- Status changed from New to Discussion
We have to:
- update parsers to understand sub-multivalued sections
- change format of LDAP serialisation for variable values (use only one attribute containing a JSON serialisation of that)
- update stringtemplate to understand the magic tag &POLICY_VARIABLES& to produce the following output:
"SA[1][PI]" string => "PI-CR-SERIAL-1";
"SA[1][vars][iA]" string => "iA1";
"SA[1][vars][iB]" string => "iB1";
"SA[1][sections][SB][1][vars][iC]" string => "iC1";
"SA[1][sections][SB][2][vars][iC]" string => "iC2";
"SA[2][PI]" string => "PI-CR-SERIAL-1";
"SA[2][vars][iA]" string => "iA2";
"SA[2][vars][iB]" string => "iB2";
"SA[2][sections][SB][1][vars][iC]" string => "iC3";
"SA[3][PI]" string => "PI-CR-SERIAL-2";
"SA[3][vars][iA]" string => "iA3";
"SA[3][vars][iB]" string => "iB3";
"SA[3][sections][SB][1][vars][iC]" string => "iC4";
"SC[1][PI]" string => "PI-CR-SERIAL-1";
"SC[1][vars][iD]" string => "iD1";
"SC[2][PI]" string => "PI-CR-SERIAL-2";
"SC[2][vars][iD]" string => "iD2";
- Status changed from Discussion to In progress
We should also keep the current syntax in .st working for variables in non-multivalued sub-section.
- Status changed from In progress to Pending technical review
Actually, the use case is not complete, because variable under the root section are missing.
<SECTIONS>
<INPUT name="iRoot" />
<SECTION name="SX" component="true" />
<SECTION name="SA" multivalued="true">
<INPUT name="iA" />
<INPUT name="iB" />
<SECTION name="SB" multivalued="true">
<input name="iC" />
</SECTION>
</SECTION>
<SECTION name="SC">
<input name="iC" />
</SECTION>
</SECTIONS>
And values:
- PI-CR-SERIAL-1:
- iRoot : iRoot1
- #SA : SA1
- iA : iA1
- iB : iB1
- #SB : SB1
- #SB : SB2
- #SA : SA2
- iA : iA2
- iB : iB3
- #SB : SB3
- #SC : SC1
- PI-CR-SERIAL-2:
- iRoot : iRoot2
- #SA : SA3
- iA : iA3
- iB : iB3
- #SB : SB4
- #SC : SC2
And so, the final structure must be (with ROOT a magic key-word):
"ROOT[1][PI]" string => "PI-CR-SERIAL-1";
"ROOT[1][vars][iRoot]" string => "iRoot1";
"ROOT[2][PI]" string => "PI-CR-SERIAL-2";
"ROOT[2][vars][iRoot]" string => "iRoot2";
"SA[1][PI]" string => "PI-CR-SERIAL-1";
"SA[1][vars][iA]" string => "iA1";
"SA[1][vars][iB]" string => "iB1";
"SA[1][sections][SB][1][vars][iC]" string => "iC1";
"SA[1][sections][SB][2][vars][iC]" string => "iC2";
"SA[2][PI]" string => "PI-CR-SERIAL-1";
"SA[2][vars][iA]" string => "iA2";
"SA[2][vars][iB]" string => "iB2";
"SA[2][sections][SB][1][vars][iC]" string => "iC3";
"SA[3][PI]" string => "PI-CR-SERIAL-2";
"SA[3][vars][iA]" string => "iA3";
"SA[3][vars][iB]" string => "iB3";
"SA[3][sections][SB][1][vars][iC]" string => "iC4";
"SC[1][PI]" string => "PI-CR-SERIAL-1";
"SC[1][vars][iD]" string => "iD1";
"SC[2][PI]" string => "PI-CR-SERIAL-2";
"SC[2][vars][iD]" string => "iD2";
- Status changed from Pending technical review to In progress
Status modification was a scrolling issue, sorry.
It is decided that the <sections> element can not hold variable directly.
So ignore the precedent remark.
- Target version changed from 17 to 20
- Status changed from In progress to 2
- Priority changed from 1 (highest) to 3
Stop for now, perhaps we can do what is needed for #1547 without them.
- Target version changed from 20 to 18
- Target version changed from 18 to 24
- Target version changed from 24 to Ideas (not version specific)
- Status changed from 2 to New
- Assignee deleted (
François ARMAND)
- Status changed from New to Rejected
We won't ever do it like that. It will be done through rudderc and technique editor, and loops/iterator. Closing it.
Also available in: Atom
PDF