Class | Chef::DataBag
In: | lib/chef/data_bag.rb
Parent: | Object

### Methods

cdb_destroy cdb_list cdb_load cdb_save chef_server_rest chef_server_rest create create_design_document destroy json_create list list load name new save to_hash to_json to_s validate_name!

### Included Modules

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

### Constants

VALID_NAME | = | /^[\-[:alnum:]_]+$/
DESIGN_DOCUMENT | = | { "version" => 2, "language" => "javascript", "views" => { "all" => { "map" => <<-EOJS function(doc) { if (doc.chef_type == "data_bag") { emit(doc.name, doc); } } EOJS

### Attributes

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

### Public Class methods

cdb_list(inflate=false, couchdb=nil)

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

cdb_load(name, couchdb=nil)

Load a Data Bag by name from CouchDB

chef_server_rest()
create_design_document(couchdb=nil)

Set up our CouchDB design document

json_create(o)

Create a Chef::Role from JSON

list(inflate=false)
load(name)

Load a Data Bag by name via the RESTful API

new(couchdb=nil)

Create a new Chef::DataBag

validate_name!(name)

### Public Instance methods

cdb_destroy()

Remove this Data Bag from CouchDB

cdb_save()

Save this Data Bag to the CouchDB

chef_server_rest()
create()

create a data bag via RESTful API

destroy()
list(inflate=false)

List all the items in this Bag from CouchDB The self.load method does this through the REST API

name(arg=nil)
save()

Save the Data Bag via RESTful API

to_hash()
to_json(*a)

Serialize this object as a hash

to_s()

As a string

[Validate]