/rancher-api-bundle

Rancher API Bundle for the Symfony Framework

Primary LanguagePHPMIT LicenseMIT

RancherApiBundle

Rancher API Bundle for the Symfony Framework.

⚠️ This project is no longer maintained. ⚠️

SensioLabsInsight

## Installation

  • Install Rancher API Bundle via composer:
composer require mauchede/rancher-api
  • Enable the bundle in AppKernel:
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Mauchede\RancherApiBundle\MauchedeRancherApiBundle(),
            // ...
        );

        // ...
    }

    // ...
}
  • Configure the projects in config.yml:
rancher_api:
    projects:
        project_A:
            endpoint: #...
            access_key: #...
            secret_key: #...
        project_B:
            endpoint: #...
            access_key: #...
            secret_key: #...

Note: endpoint and the API Keys (access_key and secret_key) can be found in Rancher settings ([Rancher URL]/settings/api).

Project name (here project_A and project_B) does not match with the Rancher's project/environment: you are free to choose the best name.

Usage

The Bundle will create a service rancher_api.projects.[project_name]. This service will be an instance of Mauchede\RancherApi\Resource\Project.

With the example of configuration, two services will be created:

  • rancher_api.projects.project_A
  • rancher_api.projects.project_B.

You can inject these services to another service or to use them in yours controllers.

Links