Why: Sub of #761 - so that we can automatically add the return values of one plugin to the inputs array under the name required by another plugin
What: Build a feature in IF that maps a parameter that is present in the input data to a new name that is expected by a particular plugin. For example, let's say a hypothetical plugin, myPlugin expects to see cpu/util in the inputs array. That p[recise parametr is not available in the array, but the precise same information is available with the cpu-utilization name. In this case, we want to use the mapping feature to pass the value of cpu-utilization to myPlugin as cpu/util.
The configuration for this should be done in the manifest, in the initialization bock for each plugin, for example:
In this case, my-plugin, which expects to see cpu/util will understand that it should use the cpu-utilization values rather than throwing an error because cpu/util is not available.
Scope of work:
[ ] Implement mapping feature
[ ] Add unit tests
Acceptance criteria
[ ] mapping feature allows re-keying data in the inputs array for the purpose of executing an individual plugin
GIVEN the feature is implemented
WHEN I run the following manifest:
THEN IF should map the available energy-from-cpu and energy-from-network values to the expected cpu/energy and network/energy values and correctly execute the sum plugin, yielding the following manifest:
Why: Sub of #761 - so that we can automatically add the return values of one plugin to the inputs array under the name required by another plugin
What: Build a feature in IF that maps a parameter that is present in the
input
data to a new name that is expected by a particular plugin. For example, let's say a hypothetical plugin,myPlugin
expects to seecpu/util
in theinputs
array. That p[recise parametr is not available in the array, but the precise same information is available with thecpu-utilization
name. In this case, we want to use themapping
feature to pass the value ofcpu-utilization
tomyPlugin
ascpu/util
.The configuration for this should be done in the manifest, in the initialization bock for each plugin, for example:
In this case,
my-plugin
, which expects to seecpu/util
will understand that it should use thecpu-utilization
values rather than throwing an error becausecpu/util
is not available.Scope of work:
Acceptance criteria
mapping
feature allows re-keying data in theinputs
array for the purpose of executing an individual plugin GIVEN the feature is implemented WHEN I run the following manifest:THEN IF should map the available
energy-from-cpu
andenergy-from-network
values to the expectedcpu/energy
andnetwork/energy
values and correctly execute thesum
plugin, yielding the following manifest:This behaviour should generalize to any plugin.