Rancher API is a set of PHP classes for interacting with Rancher.
## Installation
Rancher API can be installed via composer:
composer require mauchede/rancher-api
Note: To use the JMS annotation, you may have to configure your autoload
. You can find an example in bootstrap.php.dist.
use Mauchede\RancherApi\Client\Client;
use Mauchede\RancherApi\Resource\Project;
$client = new Client('access_key', 'secret_key');
$project = $client->get('endpoint', Project::class);
$containers = $project->getContainers();
endpoint
and the API Keys (access_key
and secret_key
) can be found in Rancher settings ([Rancher URL]/settings/api
).
Note: API keys are only available for one project/environment.