Class | Chef::DataBagItem
In: | lib/chef/data_bag_item.rb
Parent: | Object

### Methods

== cdb_destroy cdb_load cdb_save chef_server_rest chef_server_rest create create_design_document data_bag destroy from_hash id inspect json_create load name new object_name object_name pretty_print raw_data raw_data= save to_hash to_json to_s validate_id! validate_id!

### Included Modules

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

### Constants

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

### Attributes

couchdb | [RW] |
couchdb_id | [RW] |
couchdb_rev | [RW] |
raw_data | [R] |

### Public Class methods

cdb_load(data_bag, name, couchdb=nil)

Load a Data Bag Item by name from CouchDB

chef_server_rest()
create_design_document(couchdb=nil)

Set up our CouchDB design document

from_hash(h)
json_create(o)

Create a Chef::DataBagItem from JSON

load(data_bag, name)

Load a Data Bag Item by name via RESTful API

new(couchdb=nil)

Create a new Chef::DataBagItem

object_name(data_bag_name, id)
validate_id!(id_str)

### Public Instance methods

==(other)
cdb_destroy()

Remove this Data Bag Item from CouchDB

cdb_save()

Save this Data Bag Item to CouchDB

chef_server_rest()
create()

Create this Data Bag Item via RESTful API

data_bag(arg=nil)
destroy(data_bag=data_bag, databag_item=name)
id()
inspect()
name()
object_name()
pretty_print(pretty_printer)
raw_data()
raw_data=(new_data)
save(item_id=@raw_data['id'])

Save this Data Bag Item via RESTful API

to_hash()
to_json(*a)

Serialize this object as a hash

to_s()

As a string

validate_id!(id_str)

[Validate]