Class | Chef::Environment
In: | lib/chef/environment.rb
Parent: | Object

### Methods

add_cookbook_constraint_error cdb_destroy cdb_list cdb_load cdb_load_filtered_cookbook_versions cdb_load_filtered_recipe_list cdb_minimal_filtered_versions cdb_save chef_server_rest chef_server_rest cookbook cookbook_versions couchdb_id= create create_default_environment create_design_document default_attributes description destroy exists? invalid_fields json_create list load load_filtered_recipe_list name new override_attributes save to_hash to_json to_s update_attributes_from_params update_cookbook_constraint_from_param update_from! update_from_params validate_cookbook_version validate_cookbook_versions validate_required_attrs_present

### Included Modules

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

### Constants

DEFAULT | = | "default"
COMBINED_COOKBOOK_CONSTRAINT | = | /(.+)(?:[\s]+)((?:#{Chef::VersionConstraint::OPS.join('|')})(?:[\s]+).+)$/.freeze
DESIGN_DOCUMENT | = | { "version" => 1, "language" => "javascript", "views" => { "all" => { "map" => <<-EOJS function(doc) { if (doc.chef_type == "environment") { emit(doc.name, doc); } } EOJS

### Attributes

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

### Public Class methods

cdb_list(inflate=false, couchdb=nil)
cdb_load(name, couchdb=nil)
cdb_load_filtered_cookbook_versions(name, couchdb=nil)

Loads the set of Chef::CookbookVersion objects available to a given environment

### Returns

Hash i.e. {

      "cookbook_name" => [ Chef::CookbookVersion ... ] ## the array of CookbookVersions is sorted highest to lowest

}

There will be a key for every cookbook. If no CookbookVersions are available for the specified environment the value will be an empty list.

cdb_load_filtered_recipe_list(name, couchdb=nil)
cdb_minimal_filtered_versions(name, couchdb=nil)

Like `cdb_load_filtered_cookbook_versions`, loads the set of cookbooks available in a given environment. The difference is that this method will load Chef::MinimalCookbookVersion objects that contain only the information necessary for solving a cookbook collection for a given run list. The user of this method must call Chef::MinimalCookbookVersion.load_full_versions_of() after solving the cookbook collection to get the full objects.

### Returns

Hash i.e. {

      "cookbook_name" => [ Chef::CookbookVersion ... ] ## the array of CookbookVersions is sorted highest to lowest

}

There will be a key for every cookbook. If no CookbookVersions are available for the specified environment the value will be an empty list.

chef_server_rest()
create_default_environment(couchdb=nil)
create_design_document(couchdb=nil)

Set up our CouchDB design document

exists?(name, couchdb)
json_create(o)
list(inflate=false)
load(name)
load_filtered_recipe_list(environment)
new(couchdb=nil)
validate_cookbook_version(version)
validate_cookbook_versions(cv)

### Public Instance methods

add_cookbook_constraint_error(index, cookbook_constraint_spec)
cdb_destroy()
cdb_save()
chef_server_rest()
cookbook(cookbook, version)
cookbook_versions(arg=nil)
couchdb_id=(value)
create()
default_attributes(arg=nil)
description(arg=nil)
destroy()
invalid_fields()
name(arg=nil)
override_attributes(arg=nil)
save()
to_hash()
to_json(*a)
to_s()
update_attributes_from_params(params)
update_cookbook_constraint_from_param(index, cookbook_constraint_spec)
update_from!(o)
update_from_params(params)
validate_required_attrs_present()

[Validate]