承接 hypernode/api-client 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hypernode/api-client

最新稳定版本:0.5.0

Composer 安装命令:

composer require hypernode/api-client

包简介

Hypernode API Client for PHP

README 文档

README

Please note: this project is still in its early stages and the API may be subject to change.

Installation

composer require hypernode/api-client

The API client is HTTP client agnostic, which means that it's compatible with any HTTP client implementing PSR-18 interface.

Popular HTTP client implementations are: Guzzle and Symfony HTTP Client.

A full list of implementations, can be found here.

Usage

Acquiring an API token

Each Hypernode has an API token associated with it, you can use that to talk to the API directly. You can find the token in /etc/hypernode/hypernode_api_token. For API tokens with special permissions please contact support@hypernode.com.

Using the client

use Hypernode\Api\HypernodeClientFactory;

require_once 'vendor/autoload.php';

$client = HypernodeClientFactory::create(getenv('HYPERNODE_API_TOKEN'));

// For the Hypernode `johndoe` PHP version to 8.1 and Node.js version to 18
$job = $client->settings->setBatch('johndoe', [
    'php_version' => '8.1',
    'nodejs_version' => '18'
]);

// If something has changed, wait for the changes to be applied.
while ($job && !$job->completed()) {
    sleep(2);
    $job->refresh();
}

Supported features

Here's a list of Hypernode API features implemented in the client.

  • Listing Hypernodes related to your API key
  • Updating one or multiple Hypernode settings at once.
  • Querying/polling the logbook for the status of a job.
  • Listing, creating, updating and cancelling Brancher Hypernode instances.

Related projects

统计信息

  • 总下载量: 3.24k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 8
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-08-30