https://github.com/mangati/portainer-php-api
Portainer API client
https://github.com/mangati/portainer-php-api
api portainer
Last synced: 3 months ago
JSON representation
Portainer API client
- Host: GitHub
- URL: https://github.com/mangati/portainer-php-api
- Owner: mangati
- License: mit
- Created: 2018-01-25T16:37:37.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-06T19:06:52.000Z (almost 5 years ago)
- Last Synced: 2025-10-09T02:49:43.803Z (5 months ago)
- Topics: api, portainer
- Language: PHP
- Homepage:
- Size: 6.84 KB
- Stars: 12
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# portainer-php-api
Portainer API client
## Install
composer req mangati/portainer-api
## Usage
Managing endpoints:
```php
$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:
```php
$stacksApi = $portainer->stacks($endpoints[0]['Id']);
$stacks = $stacksApi->getAll();
print_r($stacks);
if (count($stacks)) {
$stacksApi->delete($stacks[0]['Id']);
}
```