Project

General

Profile

Actions

User story #1246

closed

Policy Configuration: multivalued section within multivalues sections

Added by Jonathan CLARKE over 13 years ago. Updated almost 3 years ago.

Status:
Rejected
Priority:
3
Assignee:
-
Category:
Web - Config management
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:

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
        • iC : iC1
      • #SB : SB2
        • iC : iC2
    • #SA : SA2
      • iA : iA2
      • iB : iB3
      • #SB : SB3
        • iC : iC3
    • #SC : SC1
      • iD : iD1
  • PI-CR-SERIAL-2:
    • #SA : SA3
      • iA : iA3
      • iB : iB3
      • #SB : SB4
        • iC : iC4
    • #SC : SC2
      • iD : iD2
Actions #1

Updated by Jonathan CLARKE over 13 years ago

  • Category changed from 14 to 9
Actions #2

Updated by François ARMAND over 13 years ago

  • 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
Actions #3

Updated by François ARMAND over 13 years ago

  • Description updated (diff)
  • Status changed from New to Discussion
Actions #4

Updated by François ARMAND over 13 years ago

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";
Actions #5

Updated by François ARMAND over 13 years ago

  • Status changed from Discussion to In progress

We should also keep the current syntax in .st working for variables in non-multivalued sub-section.

Actions #6

Updated by François ARMAND over 13 years ago

  • 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
        • iC : iC1
      • #SB : SB2
        • iC : iC2
    • #SA : SA2
      • iA : iA2
      • iB : iB3
      • #SB : SB3
        • iC : iC3
    • #SC : SC1
      • iD : iD1
  • PI-CR-SERIAL-2:
    • iRoot : iRoot2
    • #SA : SA3
      • iA : iA3
      • iB : iB3
      • #SB : SB4
        • iC : iC4
    • #SC : SC2
      • iD : iD2

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";
Actions #7

Updated by François ARMAND over 13 years ago

  • Status changed from Pending technical review to In progress

Status modification was a scrolling issue, sorry.

Actions #8

Updated by François ARMAND over 13 years ago

It is decided that the <sections> element can not hold variable directly.

So ignore the precedent remark.

Actions #9

Updated by François ARMAND over 13 years ago

  • Target version changed from 17 to 20
Actions #10

Updated by François ARMAND over 13 years ago

  • 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.

Actions #11

Updated by Jonathan CLARKE over 13 years ago

  • Target version changed from 20 to 18
Actions #12

Updated by François ARMAND about 13 years ago

  • Target version changed from 18 to 24
Actions #13

Updated by Jonathan CLARKE over 12 years ago

  • Target version changed from 24 to Ideas (not version specific)
Actions #14

Updated by Jonathan CLARKE about 12 years ago

  • Status changed from 2 to New
Actions #15

Updated by François ARMAND over 11 years ago

  • Assignee deleted (François ARMAND)
Actions #16

Updated by François ARMAND almost 3 years ago

  • 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.

Actions

Also available in: Atom PDF