org.apache.whirr.service.chef
Class Recipe

java.lang.Object
  extended by org.apache.whirr.service.chef.Recipe
All Implemented Interfaces:
org.jclouds.scriptbuilder.domain.Statement

public class Recipe
extends Object
implements org.jclouds.scriptbuilder.domain.Statement

Class representing a single Recipe. If the recipe is already in the cookbook cache or if it is available at a the central repository there is no need to provide an url.

Typical usage is:
 ...


Field Summary
 Map<String,Object> attribs
           
 String cookbook
           
 String recipe
           
 String url
           
 
Constructor Summary
Recipe(String cookbook)
          To run the default recipe from a provided cookbook with the specified name.
Recipe(String cookbook, String recipe)
          To run a particular recipe from a provided cookbook with the specified name.
Recipe(String cookbook, String recipe, String url)
          To run a particular recipe from a cookbook located at url.
 
Method Summary
 Iterable<String> functionDependencies(org.jclouds.scriptbuilder.domain.OsFamily family)
           
static org.jclouds.compute.options.RunScriptOptions recipeScriptOptions(org.jclouds.compute.options.RunScriptOptions options)
           
 String render(org.jclouds.scriptbuilder.domain.OsFamily family)
          Transforms the recipe into the series of statements that must be ran on the server (after chef is installed).
 String toJSON()
          Transforms the recipe into a JSON format that can be interpreted by the "chef-solo" command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cookbook

public final String cookbook

recipe

public final String recipe

url

public String url

attribs

public final Map<String,Object> attribs
Constructor Detail

Recipe

public Recipe(String cookbook)
To run the default recipe from a provided cookbook with the specified name.

Parameters:
cookbook -

Recipe

public Recipe(String cookbook,
              String recipe)
To run a particular recipe from a provided cookbook with the specified name.

Parameters:
cookbook -

Recipe

public Recipe(String cookbook,
              String recipe,
              String url)
To run a particular recipe from a cookbook located at url. To use the default recipe pass recipe as null

Parameters:
cookbook -
recipe -
url -
Method Detail

toJSON

public String toJSON()
Transforms the recipe into a JSON format that can be interpreted by the "chef-solo" command.

Returns:

functionDependencies

public Iterable<String> functionDependencies(org.jclouds.scriptbuilder.domain.OsFamily family)
Specified by:
functionDependencies in interface org.jclouds.scriptbuilder.domain.Statement

render

public String render(org.jclouds.scriptbuilder.domain.OsFamily family)
Transforms the recipe into the series of statements that must be ran on the server (after chef is installed).

Specified by:
render in interface org.jclouds.scriptbuilder.domain.Statement
Returns:

recipeScriptOptions

public static org.jclouds.compute.options.RunScriptOptions recipeScriptOptions(org.jclouds.compute.options.RunScriptOptions options)


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.