August-22nd-2018, 09:15 AM
(This post was last modified: January-29th-2019, 01:45 PM by Armin@netPI.)
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.
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.
„You never fail until you stop trying.“, Albert Einstein (1879 - 1955)