bumbal / rancher-php-client
A PHP Client for Rancher
Installs: 2 699
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 3
Open Issues: 0
Requires
- php: >=7.2
- ext-json: *
- guzzlehttp/guzzle: ^7.3
This package is auto-updated.
Last update: 2025-06-15 13:33:43 UTC
README
A PHP client for Rancher
This client is largely based on the structure and code used by Swagger PHP. All files are generated from the schema files found within Rancher. Checkout the generator folder for more information.
Disclaimer: I am not in any way, shape or form associated with Rancher.
Version mapping
1.0.* → Rancher v2.3.2
1.1.* → Rancher v2.5.7
Requirements
PHP 7.2.0 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json
:
{
"require": {
"bumbal/rancher-php-client": "^1.0"
}
}
Then run composer install
or
composer require bumbal/rancher-php-client
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); try { $rancherClient = new Rancher\RancherClient("https://your.racher.url/", "rancher_token", "rancher_secret"); $namespaceResource = new \Rancher\Resource\NamespaceResource($rancherClient, "c-abcdef"); $namespaceModel = new \Rancher\Model\NamespaceModel(); $namespaceModel->setName('from-php-api'); $namespaceModel->setDescription('Namespace generated with Rancher PHP Client'); $namespaceModel->setProjectId('c-abcdef:p-qwerty'); print_r($namespaceResource->create($namespaceModel)); } catch (\Rancher\RancherException $e) { echo $e->getMessage(); } ?>