• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Managing netPI's Docker from remote via RESTful API for netPI versions <
Outdated: New flow find HERE

You all know netPI's Docker web GUI portainer.io. But most of you haven't recognized that portainer.io offers a RESTful API to take control of it from remote. All that is needed is a HTTP capable client that is addressing the API function over REST.

To make it simple to understand how it works I created a Node-RED (includes a HTTP client) based flow, that shows how to login, how to list containers, images, how to pull an image, create a container, start and stop it and ALSO how to push a container from netPI back to Dockerhub for example.

Find appended the Node-RED flow you can test yourself: Load the flow.txt file to an editor and copy its content  to the clipboard and import it with "import/clipboard" in Node-RED's the top right menu pane. It is compatible with netPI's currently used portainer version 1.12.4.

Attached Files
.txt   flow.txt (Size: 20.25 KB / Downloads: 29)
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

Hey Armin

Unfortunately i can't import this flow. the box where you paste has a red frame and the import button is disabled. Might there be a copy-paste problem ?
I tried it with several node-reds and it didn't work. My own flows i can load via copy/paste. is there a possibility you could attach the flow in a *.txt-file to a post here?

thank you very much !
Indeed I see the same thing happening with my Node-RED.

While my original code was working, copying it from the post didi not work.

I updated the post now and change from inline code to a text file which works well now.

Thanks for checking it.
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

I was able to import the flow and play with it.

Unfortunately i have following problem when i'm trying to push the container to dockerhub.

{"message":"Pushing has been disabled due to licensing reasons"}

My container is based on the hilschernetpi/netpi-nodered-fieldbus:latest with my own changes. is this a licensing problem with the container or with dockerhub ?

I just want to backup my container before i update the netPIs software, during which all data gets lost i understand ?

thanks for your help
Yes it is correct that the firmware update to for example V1.1.3.0RC3 or any other revision will clear netPI's whole file system.

Only the latest released software V1.1.3.0RC3 has the netPI internal restriction "pushing disabled" removed. I suppose you are using a softare V1.1.1.0 or V1.1.2.0. In these version pushing is disabed in netPI and the error message {"message":"Pushing has been disabled due to licensing reasons"} is generated.

This restriction was implemented during our first Docker implementations in all our "Edge/IoT Gateway" products in order not to allow a later push of loaded containers you can buy for money from the internet like for example containers from IBM. At later time we felt such a restriction is no good for developers like you which is the 99% use case. And then we removed the restriction in V1.1.3.0RC3.

I don't know whether or not you also installed SSH service into your fieldbus container extra, but if so you can login to the continer over SSH and just copy the complete folders you changed with a tool like Filezilla to you local PC disk drive and play them back after the update.

If you have started the container in network "host" mode, you can easily use the web console to install the SSH service which opens the port 22 automatically. If your container is running in "bridged" mode things are a little different. You have to make a local copy of your container on netPI as it is and then start it again with port 22 opened.
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)


Possibly Related Threads...
Thread Author Replies Views Last Post
  netPI access for remote PLC confign MGharat 3 25 October-15th-2019, 09:12 AM
Last Post: Armin@netPI
  netPI Node-Red fieldbus node Error PersEE 5 49 October-8th-2019, 03:55 PM
Last Post: Armin@netPI
  [SOLVED] Docker GUI login issue MGharat 1 24 September-19th-2019, 11:50 AM
Last Post: Armin@netPI
Information netPI Docker REST API for versions >= V1.1.4.0 Patrick@netPI 1 77 July-16th-2019, 02:45 PM
Last Post: Patrick@netPI
  [SOLVED] Pull Docker Image a.w.d.m. 8 37 July-8th-2019, 11:17 AM
Last Post: Armin@netPI
  [SOLVED] Docker issues AlexRegev 7 192 June-26th-2019, 02:14 PM
Last Post: AlexRegev
Question Driver for RS485 (netPI) ArteLukas 5 38 June-25th-2019, 07:10 AM
Last Post: Armin@netPI
  [SOLVED] netPI stops working (502 - Bad Gateway) Andi 3 36 June-19th-2019, 03:58 PM
Last Post: Andi
  docker timing MGharat 2 34 June-13th-2019, 08:57 AM
Last Post: Patrick@netPI
  Launching multi-containers at a time - Docker stacks Armin@netPI 0 23 June-4th-2019, 04:11 PM
Last Post: Armin@netPI

Forum Jump:

Users browsing this thread: 1 Guest(s)