org.jclouds.chef
Interface ChefService

All Known Implementing Classes:
BaseChefService

public interface ChefService

Provides high level Chef operations.


Method Summary
 void cleanupStaleNodesAndClients(String prefix, int secondsStale)
          Removes the nodes and clients that have been inactive for a given amount of time.
 org.jclouds.scriptbuilder.domain.Statement createBootstrapScriptForGroup(String group)
          Creates all steps necessary to bootstrap the node.
 Node createNodeAndPopulateAutomaticAttributes(String nodeName, Iterable<String> runList)
          Creates a new node and populates the automatic attributes.
 byte[] decrypt(com.google.common.io.InputSupplier<? extends InputStream> supplier)
          Decrypts the given input stream.
 void deleteAllClientsInList(Iterable<String> names)
          Deletes the given clients.
 void deleteAllNodesInList(Iterable<String> names)
          Deletes the given nodes.
 byte[] encrypt(com.google.common.io.InputSupplier<? extends InputStream> supplier)
          Encrypts the given input stream.
 org.jclouds.domain.JsonBall getBootstrapConfigForGroup(String group)
          Gets the bootstrap configuration for a given group.
 ChefContext getContext()
          Gets the context that created this service.
 List<String> getRunListForGroup(String group)
          Gets the run list for the given group.
 Iterable<? extends Client> listClients()
          Lists the details of all existing clients.
 Iterable<? extends Client> listClients(ExecutorService executorService)
          Lists the details of all existing clients, but executing concurrently using the threads available in the ExecutorService.
 Iterable<? extends CookbookVersion> listCookbookVersions()
          Lists the details of all existing cookbooks.
 Iterable<? extends CookbookVersion> listCookbookVersions(ExecutorService executorService)
          Lists the details of all existing cookbooks.
 Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName)
          Lists the details of all existing cookbooks in an environment.
 Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName, ExecutorService executorService)
          Lists the details of all existing cookbooks in an environment.
 Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName, String numVersions)
          Lists the details of all existing cookbooks in an environment limiting number of versions.
 Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName, String numVersions, ExecutorService executorService)
          Lists the details of all existing cookbooks in an environment limiting number of versions.
 Iterable<? extends Environment> listEnvironments()
          Lists the details of all existing environments.
 Iterable<? extends Node> listNodes()
          Lists the details of all existing nodes.
 Iterable<? extends Node> listNodes(ExecutorService executorService)
          Lists the details of all existing nodes, executing concurrently using the executorService.
 Iterable<? extends Node> listNodesInEnvironment(String environmentName)
          Lists the details of all existing nodes in the given environment.
 Iterable<? extends Node> listNodesInEnvironment(String environmentName, ExecutorService executorService)
          Lists the details of all existing nodes in the given environment, using the ExecutorService to paralleling the execution.
 void updateAutomaticAttributesOnNode(String nodeName)
          Updates and populate the automatic attributes of the given node.
 void updateBootstrapConfigForGroup(String group, BootstrapConfig bootstrapConfig)
          Configures how the nodes of a certain group will be bootstrapped
 

Method Detail

getContext

ChefContext getContext()
Gets the context that created this service.

Returns:
The context that created the service.

encrypt

byte[] encrypt(com.google.common.io.InputSupplier<? extends InputStream> supplier)
               throws IOException
Encrypts the given input stream.

Parameters:
supplier - The input stream to encrypt.
Returns:
The encrypted bytes for the given input stream.
Throws:
IOException - If there is an error reading from the input stream.

decrypt

byte[] decrypt(com.google.common.io.InputSupplier<? extends InputStream> supplier)
               throws IOException
Decrypts the given input stream.

Parameters:
supplier - The input stream to decrypt.
Returns:
The decrypted bytes for the given input stream.
Throws:
IOException - If there is an error reading from the input stream.

createBootstrapScriptForGroup

org.jclouds.scriptbuilder.domain.Statement createBootstrapScriptForGroup(String group)
Creates all steps necessary to bootstrap the node.

Parameters:
group - corresponds to a configured ChefProperties#CHEF_BOOTSTRAP_DATABAG data bag where run_list and other information are stored.
Returns:
The script used to bootstrap the node.

updateBootstrapConfigForGroup

void updateBootstrapConfigForGroup(String group,
                                   BootstrapConfig bootstrapConfig)
Configures how the nodes of a certain group will be bootstrapped

Parameters:
group - The group where the given bootstrap configuration will be applied.
bootstrapConfig - The configuration to be applied to the nodes in the group.

getRunListForGroup

List<String> getRunListForGroup(String group)
Gets the run list for the given group.

Parameters:
The - group to get the configured run list for.
Returns:
run list for all nodes bootstrapped with a certain group

getBootstrapConfigForGroup

org.jclouds.domain.JsonBall getBootstrapConfigForGroup(String group)
Gets the bootstrap configuration for a given group.

The bootstrap configuration is a Json object containing the run list and the configured attributes.

Parameters:
group - The name of the group.
Returns:
The bootstrap configuration for the given group.

createNodeAndPopulateAutomaticAttributes

Node createNodeAndPopulateAutomaticAttributes(String nodeName,
                                              Iterable<String> runList)
Creates a new node and populates the automatic attributes.

Parameters:
nodeName - The name of the node to create.
runList - The run list for the created node.
Returns:
The created node with the automatic attributes populated.
See Also:
OhaiModule, ChefUtils#ohaiAutomaticAttributeBinder(com.google.inject.Binder)

updateAutomaticAttributesOnNode

void updateAutomaticAttributesOnNode(String nodeName)
Updates and populate the automatic attributes of the given node.

Parameters:
nodeName - The node to update.

cleanupStaleNodesAndClients

void cleanupStaleNodesAndClients(String prefix,
                                 int secondsStale)
Removes the nodes and clients that have been inactive for a given amount of time.

Parameters:
prefix - The prefix for the nodes and clients to delete.
secondsStale - The seconds of inactivity to consider a node and client obsolete.

deleteAllNodesInList

void deleteAllNodesInList(Iterable<String> names)
Deletes the given nodes.

Parameters:
names - The names of the nodes to delete.

deleteAllClientsInList

void deleteAllClientsInList(Iterable<String> names)
Deletes the given clients.

Parameters:
names - The names of the client to delete.

listNodes

Iterable<? extends Node> listNodes()
Lists the details of all existing nodes.

Returns:
The details of all existing nodes.

listNodes

Iterable<? extends Node> listNodes(ExecutorService executorService)
Lists the details of all existing nodes, executing concurrently using the executorService.

Returns:
The details of all existing nodes.

listNodesInEnvironment

Iterable<? extends Node> listNodesInEnvironment(String environmentName)
Lists the details of all existing nodes in the given environment.

Parameters:
environmentName - The name fo the environment.
Returns:
The details of all existing nodes in the given environment.

listNodesInEnvironment

Iterable<? extends Node> listNodesInEnvironment(String environmentName,
                                                ExecutorService executorService)
Lists the details of all existing nodes in the given environment, using the ExecutorService to paralleling the execution.

Parameters:
executorService - The thread pool used in this operation
environmentName - The name fo the environment.
Returns:
The details of all existing nodes in the given environment.

listClients

Iterable<? extends Client> listClients()
Lists the details of all existing clients.

Returns:
The details of all existing clients.

listClients

Iterable<? extends Client> listClients(ExecutorService executorService)
Lists the details of all existing clients, but executing concurrently using the threads available in the ExecutorService.

Returns:
The details of all existing clients.

listCookbookVersions

Iterable<? extends CookbookVersion> listCookbookVersions()
Lists the details of all existing cookbooks.

Returns:
The details of all existing cookbooks.

listCookbookVersions

Iterable<? extends CookbookVersion> listCookbookVersions(ExecutorService executorService)
Lists the details of all existing cookbooks. This method is executed concurrently, using the threads available in the ExecutorService.

Returns:
The details of all existing cookbooks.

listCookbookVersionsInEnvironment

Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName)
Lists the details of all existing cookbooks in an environment.

Parameters:
environmentName - The environment name.
Returns:
The details of all existing cookbooks in an environment.

listCookbookVersionsInEnvironment

Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName,
                                                                      ExecutorService executorService)
Lists the details of all existing cookbooks in an environment.

Parameters:
executorService - The thread pool to do the concurrent execution.
environmentName - The environment name.
Returns:
The details of all existing cookbooks in an environment.

listCookbookVersionsInEnvironment

Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName,
                                                                      String numVersions)
Lists the details of all existing cookbooks in an environment limiting number of versions.

Parameters:
environmentName - The environment name.
numVersions - The number of cookbook versions to include. Use 'all' to return all cookbook versions.
Returns:
The details of all existing cookbooks in environment.

listCookbookVersionsInEnvironment

Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName,
                                                                      String numVersions,
                                                                      ExecutorService executorService)
Lists the details of all existing cookbooks in an environment limiting number of versions.

Parameters:
executorService - The executorService used to do this operation concurrently.
environmentName - The environment name.
numVersions - The number of cookbook versions to include. Use 'all' to return all cookbook versions.
Returns:
The details of all existing cookbooks in environment.

listEnvironments

Iterable<? extends Environment> listEnvironments()
Lists the details of all existing environments.

Returns:
The details of all existing environments.


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.