diff --git a/doc/source/resource.rst b/doc/source/resource.rst index 0f66c247..68b88596 100644 --- a/doc/source/resource.rst +++ b/doc/source/resource.rst @@ -93,6 +93,45 @@ all values are correct. ``!`` at the end of a type means that it is required * list with lists ``[[]]`` +Input manipulation +~~~~~~~~~~~~~~~~~~ +There is possibility to add and remove inputs from given resource. +To do so you can use ``solar input add`` or ``solar input remove`` in Solar CLI. + + +Computable Inputs +----------------- +Computable input is special input type, it shares all logic that standard input has (connections etc), +but you can set a function that will return final input value. + +.. note:: + Remeber, that you need to connect inputs to have it accessible in Computable Inputs logic. + +Currently you can write the functions using: + +- Pure Python +- Jinja2 template +- LUA + +Besides that there are 2 types of Computable Inputs: + +- ``values`` + + - all connected inputs are passed by value as ``D`` variable + +- ``full`` + + - all connected inputs are passed as array (python dict type) as ``R`` variable, so you have full information about input. + + +In addition for ``jinja`` all connected inputs for current resource are accessible as first level variables. + + +Change computable input +~~~~~~~~~~~~~~~~~~~~~~~ +You can change Computable Input properties by calling ``solar input change_computable`` in Solar CLI. + + Action ------ Solar wraps deployment code into actions with specific names. Actions are diff --git a/solar/test/test_resource.py b/solar/test/test_resource.py index 78a65732..d04aeb7e 100644 --- a/solar/test/test_resource.py +++ b/solar/test/test_resource.py @@ -162,6 +162,7 @@ input: """) sample1 = self.create_resource('sample1', sample_meta_dir) + with self.assertRaises(Exception): # NOQA sample1.input_computable_change('value', '{{value}}') return sample1