定制 xenolope/grizzwald 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

xenolope/grizzwald

最新稳定版本:1.0.0

Composer 安装命令:

composer require xenolope/grizzwald

包简介

A client library to interact with the CoreOS fleet API

README 文档

README

"Grizz was in the Navy" - Tracy Jordan, 30 Rock (S01E01: The Aftermath)

Description

Grizzwald is a simple PHP library that interacts with the CoreOS fleet API, for easy management of your cluster's unit files.

Installation

The library can be installed with Composer, by including the following in your composer.json:

{
    "require": {
        "xenolope/grizzwald": "~1.0"
    }
}

Usage

// Create a new instance of the client, passing in the base URL to your fleet instance
$client = new FleetClient('http://172.16.1.100:49153');

// Get a list of all the machines in the cluster
$machines = $client->listMachines(); // Returns an array of \Xenolope\Grizzwald\Entity\Machine objects

// Get a list of all the unit states in the cluster
$states = $client->listUnitStates(); // Returns an array of \Xenolope\Grizzwald\Entity\UnitState objects

// Get a list of all the units in the cluster
$units = $client->listUnits(); // Returns an array of \Xenolope\Grizzwald\Entity\Unit objects

// Get a single unit from the cluster
$unit = $client->getUnit('nginx.service'); // Returns a \Xenolope\Grizzwald\Entity\Unit object

// Create a new unit on the cluster
$unit = new Unit('nginx.service', [
    new UnitOption('Service', 'ExecStart', '/usr/sbin/nginx') // One or more UnitOptions are required 
], Unit::STATE_LAUNCHED);

$client->createUnit($unit);

// Modify an existing unit on the cluster
$unit = new Unit('nginx.service', Unit::STATE_LOADED);

$client->modifyUnit($unit);

// Destroy a unit on the cluster
$client->destroyUnit('nginx.service');

License

Grizzwald is released under the MIT License; please see LICENSE for more information.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-11