• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Managing netPI's Docker from remote via RESTful API for netPI versions < 1.1.4.0
#1
Information 
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: 34)
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#2
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 !
  Reply
#3
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)

  Reply
#4
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
  Reply
#5
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)

  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  https certificate issues in new nodered docker image Dipro 1 1,666 May-4th-2022, 05:46 AM
Last Post: Armin@netPI
  Trouble resetting NetPI a.w.d.m. 7 3,173 February-9th-2022, 10:02 AM
Last Post: a.w.d.m.
  cannot execute file: Exec format error - NETPI tuliosouza 1 1,743 January-13th-2022, 01:17 PM
Last Post: Armin@netPI
  Ways to replace NetPi with/copy Config to new NetPi Dipro 2 2,126 December-7th-2021, 08:42 PM
Last Post: Armin@netPI
  NetPI WiFi through Internet DSongra 1 1,952 September-7th-2021, 07:54 AM
Last Post: Armin@netPI
  NetPI wifi access to WPA2-Enterprise MikeP 4 4,258 September-3rd-2021, 02:56 PM
Last Post: MikeP
  netPI opc ua server pull image error wswitula 3 3,114 August-27th-2021, 10:47 AM
Last Post: wswitula
  OPC UA server with NetPi RTE DSongra 9 4,213 July-27th-2021, 12:01 PM
Last Post: Armin@netPI
  Node-RED 'projects' possible on netPI? JG_KIT 2 2,305 July-20th-2021, 01:11 PM
Last Post: JG_KIT
  Docker exposed port don't send data on eth0 COswald 3 3,108 July-15th-2021, 02:10 PM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)