samuel4x4/chefauth-guzzle-plugin
Composer 安装命令:
composer require samuel4x4/chefauth-guzzle-plugin
包简介
A guzzle (v3) plugin handling all authentication for Chef server API.
README 文档
README
A guzzle (v3) plugin handling all authentication for Chef server API.
requirements
- PHP 5.3
- Guzzle 3
installation
First you need Guzzle, offcourse.
Add the leaseweb/chefauth-guzzle-plugin as a dependency to your project:
$ php composer.phar require "leaseweb/chefauth-guzzle-plugin":"1.0.0"
Composer will install the plugin to your project's vendor/leaseweb directory.
You are now ready to use the plugin.
usage
Create a new guzzle client pointing to your chef server:
// Supply your client name and location of the private key.
$chefAuthPlugin = new \LeaseWeb\ChefGuzzle\Plugin\ChefAuth\ChefAuthPlugin("client-name", "/tmp/client-name.pem");
// Create a new guzzle client
$client = new \Guzzle\Http\Client('https://manage.opscode.com');
$client->addSubscriber($chefAuthPlugin);
// Now you can make calls to the chef server
$response = $client->get('/organizations/my-organization/nodes')->send();
$nodes = $response->json();
Read more about guzzle here http://guzzle3.readthedocs.org/docs.html
license
MIT
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-08-22