lion2486 / portainer-api
Portainer API客户端
v0.4.3
2020-11-11 14:05 UTC
Requires
- lion2486/api-client: ^0.3.3
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']); }