mangati / portainer-api
Portainer API 客户端
v0.5.0
2021-05-06 19:02 UTC
Requires
- mangati/api-client: ^0.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']); }