Skip to content

PHP SDK for managing RunCloud servers with the Version 2 API.

License

Notifications You must be signed in to change notification settings

onhovercode/runcloud-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RunCloud API PHP SDK

This SDK helps you make API calls to the RunCloud Version 2 API and is a fork of the RunCloud PHP SDK.

RunCloud API Documentation

Installation

Install the SDK in your project using Composer:

composer require onhover/runcloud-sdk

Use Composer's autoload:

require __DIR__ . '/../vendor/autoload.php';

Create an instance of the SDK:

$runcloud = new OnHover\RunCloud\RunCloud('MY_API_KEY', 'MY_API_SECRET');

Usage

You can use the $runcloud instance to make all available API calls.

To find out all available methods, inspect the appropriate classes in the Actions directory. The names of these classes and functions closely follow the RunCloud API Documentation.

Examples

$response = $runcloud->ping();

This tests the connection to the API and should return the string "pong".

$servers = $runcloud->servers();

This will return an array of servers you have access to. Each array item will be an instance of OnHover\RunCloud\Resources\Server and contains various properties such as id, name, provider and ipAddress.

You can return a single Server instance like this:

$serverId = 12345;
$server = $runcloud->server($serverId);

Some methods require parameters to be supplied as an array.

$serverId = 12345;

$data = [
	'type' => 'global',
	'port' => '8080-8081',
	'protocol' => 'tcp',
];

$rule = $runcloud->createFirewallRule($serverId, $data);

Security

If you discover any security related issues, please email code@onhover.co.uk instead of using the issue tracker.

Credits

This package uses code from and is greatly inspired by the Forge SDK package by Mohammed Said and the Oh Dear PHP SDK package.

License

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

About

PHP SDK for managing RunCloud servers with the Version 2 API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%