Portainer API client
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2018-06-07 17:20:05 +01:00
src API Request counting, smarter authing. 2018-06-07 17:20:05 +01:00
.gitignore init 2018-01-25 14:51:16 -02:00
composer.json oops 2018-04-25 18:32:58 +01:00
composer.lock updated dep 2018-03-15 18:55:25 -03:00
LICENSE Initial commit 2018-01-25 14:37:38 -02:00
README.md renamed composer package 2018-01-25 15:06:10 -02:00

portainer-php-api

Portainer API client

Install

composer req mangati/portainer-api

Usage

Managing endpoints:

$portainer = new \Mangati\Portainer\Client('http://127.0.0.1:9000');
$portainer->auth('admin', '123456789');

$endpointsApi = $portainer->endpoints();
$endpoints    = $endpointsApi->getAll();

print_r($endpoints);

Managing stacks:

$stacksApi = $portainer->stacks($endpoints[0]['Id']);
$stacks    = $stacksApi->getAll();

print_r($stacks);

if (count($stacks)) {
    $stacksApi->delete($stacks[0]['Id']);
}