Chef::REST::Client
1.2
use Chef::REST::Client;
my $obj = new Chef::REST::Client ( 'chef_client_name' => $chef_client_name , 'chef_client_privaate_key' => $private_key );
$obj->private_key( $private_key ); $obj->name( $chef_client_name ); $obj->roles('vagrant')->details; $obj->roles('vagrant','environments')->details $obj->roles->list; $obj->search( 'secrets' , { q => 'id:centrify', rows => 1 } )->details $obj->environments(<env_name>,'cookbooks' , <cookbook_name>)->details; $obj->environments(<env_name>,'cookbooks_versions' ,{ 'method' => 'post' , 'data' => { 'runlist' => [ 'ms-scribe'] } } ); $obj->roles(<role_name>)->details->override_attributes;
This is the interface to the Chef server api methods listed on opscode documentation opscode Chef Api currently it provides implementation for only GET methods
returns new Chef::REST::Client::role object used by other classes
makes a GET request to the chef server for all the @roles and returns and Chef::REST::Client::roles object. you can directly get details for all the roles as $obj->role( 'role1', 'role2' )->details;
this inturn will return Chef::REST::Client::role
$obj->roles->list
$obj->roles(<role_name>)->details
$obj->roles(<role_name>)->details->run_list;
$obj->roles(<role_name>)->details->override_attributes;
returns new Chef::REST::Client::runlist object. it takes a list of recipies as parameter. used by other classes
returns new Chef::REST::Client::sandboxes object. $obj->sandboxes->list;
$obj->sandboxes->list
$obj->sandboxes(<id>)->details
returns new Chef::REST::Client::search
$obj->search->listen
$obj->search(<index>)->details
$obj->search( 'secrets' , { q => 'id:centrify', rows => 1 } )->details
returns new Chef::REST::Client::recipe object. used by other classes
returns new Chef::REST::Client::principals object. $obj->principals->details;
$obj->principals->list
$obj->principals(<name>)->details
returns new Chef::REST::Client::node object. $obj->node->details; used by other classes
returns new Chef::REST::Client::nodes object. $obj->nodes->list;
$obj->nodes->listen
$obj->nodes(<node_name>)->details
returns new Chef::REST::Client::envrunnlist object. used by other classes
returns new Chef::REST::Client::environment object. used by other classes
returns new Chef::REST::Client::environments object.
$obj->environments(<env_name>)->details;
$obj->environments(<env_name>,'cookbooks' , <cookbook_name>)->details;
$obj->environments(<env_name>,'cookbooks')
$obj->environments(<env_name>,'cookbooks_versions' ,{ 'method' => 'post' , 'data' => { 'runlist' => [ 'ms-scribe'] } } );
returns new Chef::REST::Client::databag object.
returns new Chef::REST::Client::data object.
$obj->data->list
$obj->data( <var_name> )->details
returns new Chef::REST::Client::cookbook object.
returns new Chef::REST::Client::cookbooks object.
$obj->cookbooks->list
$obj->cookbooks(<cookbook_name>)->details
$obj->cookbooks(<cookbook_name> , '_latest' )->details->recipes;
$obj->cookbooks(<cookbook_name> , '_latest' )->details->attributes;
returns new Chef::REST::Client::cookbook_version object. used by other classes
returns new Chef::REST::Client::cookbook_versions object. collection of Chef::REST::Client::cookbook_version
returns new Chef::REST::Client::clients object.
$obj->clients->list
$obj->clients(<client_name>)->details
returns new Chef::REST::Client::attribute object. used by other classes to structure data
returns new Chef::REST::Client::attributes object. collection of Chef::REST::Client::attribute
open a github ticket or email comments to Bhavin Patel <bpatel10@nyit.edu>
This Software is free to use , licensed under : The Artisic License 2.0 (GPL Compatible)
To install Chef::REST::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Chef::REST::Client
CPAN shell
perl -MCPAN -e shell install Chef::REST::Client
For more information on module installation, please visit the detailed CPAN module installation guide.