Enables very easy access to Rancher from your Yii2 application.
Supports Rancher V2 beta (Rancher 1.6 API) and a single Rancher environment.
API-Resurces supported (easily expandable, see Rancher.php
):
- Get a list of stacks
- Deactivate a stack
Accesses Rancher via the fantastic Rancher API
Add System-Info to the require section of your composer.json file:
{
"require": {
"weesee/yii2-rancher": "~1.0.0"
}
}
And run following command to download extension using composer:
$ php composer.phar update
To configure Rancher API access for your Environment:
- In the Rancher UI: Open API->Keys
- Open "Advanced Options"
- Add an Environment API Key
- Copy Access Key (Username) and Secret Key (Password)
- Copy Endpoint (v2-beta)
Get Rancher stacks:
use weesee\Rancher;
// Get Rancher stacks
$rancher = new RancherApi([
'apiEndpointUrl' => '...', // Rancher Endpoint (v2-beta)
'apiUsername' => '...', // Rancher Access Key (Username)
'apiPassword' => '...', // Rancher Secret Key (Password)
]);
// get system details as Yii2 model
$stacks = $rancher->getStacks();
Contributing instructions are located in CONTRIBUTING.md file.
Author: weesee@web.de
(C) 2018 WeeSee