PHP Fly.io API Client
, (*1)
This package makes it easy to interact with the Fly.io API., (*2)
Requirements
This package requires PHP >= 5.5., (*3)
Installation
You can install the package via composer:, (*4)
``` bash
composer require m1guelpf/fly-api, (*5)
## Usage
You must pass a Guzzle client and the API token to the constructor of `M1guelpf\FlyAPI\Fly`.
``` php
$fly = new \M1guelpf\FlyAPI\Fly('YOUR_FLY_API_TOKEN');
or you can skip the token and use the connect()
method later, (*6)
``` php
$fly = new \M1guelpf\FlyAPI\Fly();, (*7)
$fly->connect('YOUR_FLY_API_TOKEN');, (*8)
### Get Hostnames
``` php
$fly->getHostnames($slug);
Create Hostname
``` php
$fly->createHostname($slug, $hostname);, (*9)
### Get Hostname
``` php
$fly->getHostname($slug, $hostname);
Create Backend
``` php
$fly->createBackend($slug, $name, $type, $settings);, (*10)
### Create Rule
``` php
$fly->createRule($slug, $hostname, $backend_id, $action_type, $path, $priority, $path_replacement);
Get the Guzzle Client
``` php
$fly->getClient();, (*11)
### Set the Guzzle Client
``` php
$client = new \GuzzleHttp\Client(); // Example Guzzle client
$fly->setClient($client);
where $client is an instance of \GuzzleHttp\Client
., (*12)
Changelog
Please see CHANGELOG for more information what has changed recently., (*13)
Testing
bash
$ composer test
, (*14)
Contributing
Please see CONTRIBUTING for details., (*15)
Security
If you discover any security related issues, please email soy@miguelpiedrafita.com instead of using the issue tracker., (*16)
Credits
License
The MIT License. Please see License File for more information., (*17)