• 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: 30)
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-desktop-hdmi with setting network=bridge tad 13 54 June-19th-2020, 12:50 PM
Last Post: tad
  Siemens PLC -Uploading and downloading using netPI & VPN SAhire@hilscher.local 14 81 June-17th-2020, 12:34 PM
Last Post: MGharat
  VPN tunnel to netPI and local network in 10 minutes Armin@netPI 0 52 June-5th-2020, 05:40 PM
Last Post: Armin@netPI
  netPI-netx-programming-examples update slos 7 40 May-29th-2020, 04:21 PM
Last Post: Armin@netPI
  Docker cannot find image COswald 16 68 May-18th-2020, 07:15 AM
Last Post: COswald
  how to pick up PROFINET data and store them to OPC UA server on Node-RED/netPI. tad 7 46 March-16th-2020, 10:21 AM
Last Post: Armin@netPI
  netPI I/O ameurdx 1 14 March-12th-2020, 08:58 AM
Last Post: Armin@netPI
  docker.service start failed EUROKEY 6 26 February-6th-2020, 09:49 AM
Last Post: EUROKEY
  After „Rebuild“ of Docker neither the node-RED nor the dashboard can be accessed MAK 4 22 January-31st-2020, 02:14 PM
Last Post: MAK
  Web browser reports "insecure connection" when accessing netPI for the first time Armin@netPI 2 102 January-31st-2020, 07:07 AM
Last Post: Armin@netPI

Forum Jump:

Users browsing this thread: 1 Guest(s)