I have a flow that runs on a few dozen remote Pis. The flow contains ten tabs, each of which I've exported an individual json file for on my development machine. I'd like to deploy only the updated flows instead of the entire flow to all the remote nodes automatically if that's possible. Most of the customization for each machine is done on one tab and since certain nodes can't be configured at runtime, this approach would be best for updates. I've spent hours looking through the admin API docs but I'm just not understanding them.
otdm-tools from my project can help you.
As one of function it have option to import / export flows from Node-RED instance from linux command line.
I'm using it to prepare .deb what is also a option for you if you want to deploy something more then one flow. To make it packitso link ...
Currently working on import export subflows -> to -> .deb
You want to remotly update / manipulate flow's on remote instances of Node-RED.
So otdm-tools can help you with sourcing desire flow from custom host get json of it then you can propagate it or make automatic update per host.
otdm-tools one more time to import it to different Node-RED instance.
So you don't need to know curl and http api for Node-RED
It's probably just me, but I'm just not getting it. The installation docs alone are confusing the hell out of me. All I want is a simple solution to copying one tab of a flow from one Pi running Node Red to a few dozen out in the field. It seems like it should be simple. Thanks anyways. I'll just stick with the time-consuming process.
What don't you understand about the admin API (though I have not actually used it)? If you want to update one flow tab then it looks as if you need PUT/flow/:id
I'm able to get an authentication token just fine, but I can't figure out how to take the contents of my json for the tab I want to replace and put that into the curl statement.
You have to put the string into the command. Are you putting the curl command into the command field in an exec node? If so then select Append msg.payload and a function node before it do
msg.payload = `"${$JSON}"`
return msg
I have used the template literals syntax as you need the string to be surrounded by quotes and that that is an easy way to do it.
Personally I would not use that as the name of a variable, it is too confusing.
I hadn't planned on putting it in Node Red quite yet. I just wanted to get it working from the command line. I'll do it whatever way works best if I can actually figure out how to do it. It's just been too much trouble trying to figure it out so far.
I only used JSON in the example to see if I was even understanding it correctly, which im obviously not. I have several individual tabs I want to update as needed, so I'd probably just use the tab names for my variables.
I don't even know where to begin. I went to the page you linked to (otdm tools) and can't even figure out how to get started with it. I looked at the pages linked on the right side of the page, including the installation manual that tells me I need an Android device to get started and then a whole bunch of other things. What do I really need for just otdm-tools?
I can appreciate the fact that you definitely put a lot of effort and time into creating your software, but I can't even figure out how to use just one piece of it.
I created an application that monitors all the rides in a theme park. There is a Pi installed at each ride running the same application in Node Red that monitors certain data and sends all the data back to another Pi running Node Red to save and display the data. The application is divided into a number of tabs and all I want is the ability to deploy an updated JSON file of specific tabs to the Pis in the field. It sounds like it should be fairly simple, but I'm finding that it's nowhere near being even relatively simple.
The first tab of the flow contains settings that I can't set at runtime and each piece of equipment is different (different PLC, different tags, etc.). If I overwrite that part of the flow, then I have to log in to each Pi individually and update the settings. It would be OK if the ethip-in, pccc-in, and dde nodes allowed for passing all the parameters to them and runtime but they don't, so I need to leave the first tab alone.
The documentation for the admin API is lacking something. With your help and further research, I was able to create a curl request that ended up deleting the tab at the destination and inserted a blank tab (no name, no content). I'm somewhat close to having it figured out, but it shouldn't be this difficult.