aashley/chef
Composer 安装命令:
composer require aashley/chef
包简介
Opscode Chef API library
关键字:
README 文档
README
The Chef Server API is used to provide access to objects on the Chef Server, including nodes, environments, roles, cookbooks (and cookbook versions), and to manage an API client list and the associated RSA public key-pairs.
This is a generic library and has additional support for the Laravel framework.
This is forked from https://github.com/jenssegers/php-chef I have some different requirements and will be maintaining it independantly. For legacy compatibility reasons I still use the original packages namespace so this is a drop in replacement.
Installation
Add aashley/chef as a requirement to composer.json:
composer require "aashley/chef" "^2.0"
Update your packages with composer update or install with composer install.
Usage
Create a chef object like this:
// composer
require_once 'vendor/autoload.php';
use Jenssegers\Chef\Chef;
// create chef object
$chef = new Chef($server, $client, $key, $version);
// API request
$response = $chef->api($endpoint, $method, $data);
See http://docs.opscode.com/api_chef_server.html for all available endpoints.
Examples
Get nodes:
$nodes = $chef->get('/nodes');
Create a data bag:
$bag = new stdClass;
$bag->name = "test";
$resp = $chef->post('/data', $bag);
Update a node:
$node = $chef->get('/nodes/webserver1');
$node->attributes->type = "webserver";
$chef->put('/nodes/webserver1', $node);
Delete a data bag:
$chef->delete('/data/test/item');
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-17