diff --git a/doc/src/SUMMARY.md b/doc/src/SUMMARY.md index dd0b383..4d73866 100644 --- a/doc/src/SUMMARY.md +++ b/doc/src/SUMMARY.md @@ -15,7 +15,8 @@ - [Request Methods](./core_request_methods.md) - [Nats timeouts](./core_nats_timeouts.md) - [Startup folder](./core_startup_folder.md) -- [{{ctrl_DATA}} variable](./core_messaging_ctrl_DATA.md) +- [{{CTRL_DATA}} variable](./core_messaging_CTRL_DATA.md) +- [{{CTRL_FILE}}](./core_messaging_CTRL_FILE.md) - [Errors](./core_errors.md) # Example standard messages diff --git a/doc/src/core_messaging_CTRL_FILE.md b/doc/src/core_messaging_CTRL_FILE.md new file mode 100644 index 0000000..96c9c37 --- /dev/null +++ b/doc/src/core_messaging_CTRL_FILE.md @@ -0,0 +1,23 @@ +# Message methodArgs variables + +## {{CTRL_FILE}} + +Read a local text file, and embed the content of the file into the methodArgs. + +```yaml +--- +- toNodes: + - btdev1 + #jetstreamToNode: btdev1 + method: cliCommand + methodArgs: + - /bin/bash + - -c + - | + echo {{CTRL_FILE:/some_directory/source_file.yaml}}>/other_directory/destination_file.yaml + methodTimeout: 3 + replyMethod: console + ACKTimeout: 0 +``` + +The above example will before sending the message read the content of the file `/some_directory/source_file.yaml`. When the message is received at it's destination node and the cliCommand is executed the content will be written to `/other_directory/destination_file.yaml`. diff --git a/doc/src/core_messaging_methodargs_variables.md b/doc/src/core_messaging_methodargs_variables.md new file mode 100644 index 0000000..3356a63 --- /dev/null +++ b/doc/src/core_messaging_methodargs_variables.md @@ -0,0 +1 @@ +# Message methodArgs variables