Playbook operations
The playbook operations apply only to those scripts used with the graphic playbook designer. The playbook operations are not available when you create a script in the Scripts tab.
The playbook keyword allows access to function results and ability to store and retrieve arbitrary property values.
The playbook keyword can access data in the current instance of the playbook only and is typically used in a local script. For an overview, see Global and local scripts.
Type playbook. in the script line to see the available operations.
Operation | Description |
---|---|
|
Accesses the inputs of a manually activated playbook or a sub-playbook. Inputs are read-only and cannot be modified. However, you can take the value and change it for use in the script, as described at the end of the table. |
|
Accesses the results of functions that were previously run in the playbook. The results are
accessible by the function output name. Use the following property reference, where
output_name is the name of the saved output of a
function.
Function results are read-only and cannot be modified. However, you can take the value and change it for use in the script, as described at the end of the table. |
|
Accesses the result of a sub-playbook for use in the parent playbook. Results are read-only and cannot be modified. However, you can take the value and change it for use in the script, as described at the end of the table. |
|
Accesses data that was previously entered by playbook.addProperty . Use the
following property reference, where propertyName is the name of an existing
playbook property.
The property
reference can be used interchangeably with
|
|
Adds or updates playbook properties. It can be any value that you need to reuse within the
playbook. Use the following command, where propertyName is any name you choose, but
must be unique. The <propertyValue> must be a Python dictionary.
The command can
be used interchangeably with |
|
Stores the result of the sub-playbook. It is used in the End point of a sub-playbook. The
results are stored in a dictionary as shown in the following example.
The sub-playbook’s result is a required field in sub-playbook’s End point. If the sub-playbook
does not have a result, use |
results
and properties
are dictionary and thus can be used
with any Python way of using dictionaries. For example,
playbook.properties.foobar['result1']
is the same as
playbook.properties.foobar.result1
. It can also be used as:
str(playbook.properties)
str(playbook.properties.foobar)
inputs
, functions
, and
subplaybook.results
are read-only and cannot be modified. However, you can take the
value and change it for use in the script. The following command shows how to change the value for
inputs
. The new value is used within the script only and is not available after the
script execution completes for that node. Any scripts that follow in the playbook see the original
value.playbook.inputs.number=playbook.inputs.number+1,