Class Chef::ApiClient
In: lib/chef/api_client.rb
Parent: Object

Methods

Included Modules

Chef::Mixin::FromFile Chef::Mixin::ParamsValidate Chef::IndexQueue::Indexable

Constants

DESIGN_DOCUMENT = { "version" => 1, "language" => "javascript", "views" => { "all" => { "map" => <<-EOJS function(doc) { if (doc.chef_type == "client") { emit(doc.name, doc); } } EOJS

Attributes

couchdb  [RW] 
couchdb_id  [RW] 
couchdb_rev  [RW] 

Public Class methods

List all the Chef::ApiClient objects in the CouchDB. If inflate is set to true, you will get the full list of all ApiClients, fully inflated.

Load a client by name from CouchDB

@params [String] The name of the client to load @return [Chef::ApiClient] The resulting Chef::ApiClient object

Load a client by name via the API

Public Instance methods

Gets or sets whether this client is an admin.

@params [Optional True/False] Should be true or false - default is false. @return [True/False] The current value

Remove this client from the CouchDB

@params [String] The name of the client to delete @return [Chef::ApiClient] The last version of the object

Save this client to the CouchDB

Create the client via the REST API

Creates a new public/private key pair, and populates the public_key and private_key attributes.

@return [True]

Remove this client via the REST API

Gets or sets the client name.

@params [Optional String] The name must be alpha-numeric plus - and _. @return [String] The current value of the name.

Gets or sets the private key.

@params [Optional String] The string representation of the private key. @return [String] The current value.

Gets or sets the public key.

@params [Optional String] The string representation of the public key. @return [String] The current value.

Save this client via the REST API, returns a hash including the private key

The hash representation of the object. Includes the name and public_key, but never the private key.

@return [Hash]

The JSON representation of the object.

@return [String] the JSON string.

As a string

[Validate]