weesee/yii2-rancher

Yii2 extension for accessing Rancher API

Installs: 6

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.0 2018-08-06 21:30 UTC

This package is not auto-updated.

Last update: 2024-11-03 04:53:15 UTC


README

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

Installation

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)

Usage

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();

Contribution

Contributing instructions are located in CONTRIBUTING.md file.

Author & Credits

Author: weesee@web.de

(C) 2018 WeeSee