Download the PHP package th0rn0/laravel-rancher without Composer

On this page you can find all versions of the php package th0rn0/laravel-rancher. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-rancher

Laravel Rancher

Rancher API wrapper for Laravel. This package provides a simple interface to Rancher's (awesome) API. Orchestrate your private container service with expressive, clean PHP.

Installation

Laravel Rancher uses compose to make installation a breeze.

Install via composer

Register service provider Add the Laravel Rancher service provider to your config/app.php file in the providers key

Rancher facade alias Then add the Rancher facade to your aliases key: 'Rancher' => Benmag\Rancher\Facades\Rancher::class.

Configuration

Configuration can be done via your .env file. `

You may also publish the config file to config/rancher.php for editing: php artisan vendor:publish --provider="Benmag\Rancher\RancherServiceProvider"

Notes

Make sure you have authentication enabled. Without this, you might experience some weird behaviour. I still need to look into changing Environments/Projects in a slightly more coordinated way but you should just be able to instantiate a new client instance.

Usage

Laravel Rancher is incredibly intuitive to use.

Introduction

Already configured everything and just want to see it in action? Take a look at the example code below.

Host

Retrieving all Hosts

Retrieve Host by ID

Activate a Host by ID

Evacuate a Host by ID

Remove a Host by ID

Container

Retrieving all Containers

Retrieve Container by ID

Create a Container

Stack

Create a Stack

When creating a Stack, you will need to tell Rancher which Project you want to create it in.

Update an Stack

Activate Services in an Stack

Deactivate Services in an Stack

Delete a Stack

Project

Create a new Project

Activate a Project

Deactivate a Project

Delete a Project

Service

Create a Service

Update a Service

Add a Service Link

You may also add a single service link to the service. You can use the name value to specify a link alias.

Set Service Links

The setServiceLinks method will overwrite all of the links for that service.

Remove a Service Link

Individual service links can also be removed

Upgrade a Service

Finish a Service Upgrade

Cancel a Service Upgrade

Rollback an Upgrade

Cancel Rollback

Load Balancer Service

Create a Load Balancer

Update a Load Balancer

Add a Service Link to Load Balancer

You may also add a single service link to the service. You can use the name value to specify a link alias.

Set Service Links for Load Balancer

The setServiceLinks method will overwrite all of the links for that load balancer.

Remove a Service Link from Load Balancer

Individual service links can also be removed.

Machine

[todo]

Registry

Add Registry

Activate Registry

Deactivate Registry

Registry Credential

Add registry credential

Registration Token

Create Registration Token

Fetch Registration Tokens

Service Consume Map

[todo]

Certificates

Get certificates

Create a certificate

Remove a certificate

Query Building

The wrapper also provides a convenient way for you to build fairly elaborate Rancher API requests. The following methods return the instance so you can chain more constraints onto the request as required.

Filters

Rancher lets you specify filters on API resources. The type of filter to apply is set via the key. Listed below is an example of all of the filter options.

Remember: to change the field you filter on, change the key e.g. ['state' => 'active'] or ['description_notnull' => null]

Include

With Rancher, you can specify additional endpoints that should be eager loaded with the request through an include parameter. This functionality is exposed via the with method.

Fields

Define additional fields from the API for the entity to dynamically expose. You can use this to enable access properties that are not explicitly defined by the entity class.

Scope

By default, Rancher's scope is the default Project your credentials have access too. This chained method lets you easily change the scope to another project your credentials have access to on the fly.

Of course, you may utilize the setClient method to change the client to something completely new but if you want to change

All together now

Here is a simple example of how you can use method chaining to build elaborate Rancher API requests.

Handling Exceptions

The Rancher API will return errors as required. I am still looking for a nicer way to handle these exceptions... For the time being, simply wrap your call in a try/catch block.

Rancher API Endpoint Coverage

The Rancher API is extensive. I've attempted to cover all of the key endpoints but there are a few endpoints that are currently unimplemented.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-rancher with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ~6.0
php Version ~5.5|~7.0
guzzlehttp/guzzle Version ~6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package th0rn0/laravel-rancher contains the following files

Loading the files please wait ....