lion2486/portainer-api

Portainer API客户端

v0.4.3 2020-11-11 14:05 UTC

This package is auto-updated.

Last update: 2024-09-24 22:41:43 UTC


README

Portainer API客户端

安装

composer req mangati/portainer-api

用法

管理端点

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

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

print_r($endpoints);

管理堆栈

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

print_r($stacks);

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