updaterbot/runcloud-sdk
最新稳定版本:1.1.1
Composer 安装命令:
composer require updaterbot/runcloud-sdk
包简介
RunCloud PHP SDK (Unofficial)
关键字:
README 文档
README
This SDK helps you make API calls to the RunCloud Version 2 API and is a fork of the RunCloud PHP SDK.
Installation
Install the SDK in your project using Composer:
composer require updaterbot/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.
统计信息
- 总下载量: 32
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-27