Package org.jclouds.chef.internal
Class BaseChefService
java.lang.Object
org.jclouds.chef.internal.BaseChefService
- All Implemented Interfaces:
ChefService
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanupStaleNodesAndClients(String prefix, int secondsStale) Removes the nodes and clients that have been inactive for a given amount of time.Creates all steps necessary to bootstrap the node.createBootstrapScriptForGroup(String group, String nodeName) Creates all steps necessary to bootstrap the node.createNodeAndPopulateAutomaticAttributes(String nodeName, Iterable<String> runList) Creates a new node and populates the automatic attributes.byte[]decrypt(InputStream input) Decrypts the given input stream.voiddeleteAllClientsInList(Iterable<String> names) Deletes the given clients.voiddeleteAllNodesInList(Iterable<String> names) Deletes the given nodes.byte[]encrypt(InputStream input) Encrypts the given input stream.getBootstrapConfigForGroup(String group) Gets the bootstrap configuration for a given group.Lists the details of all existing clients.listClients(ExecutorService executorService) Lists the details of all existing clients, but executing concurrently using the threads available in the ExecutorService.Iterable<? extends CookbookVersion> 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, 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 CookbookVersion> listCookbookVersionsInEnvironment(String environmentName, ExecutorService executorService) Lists the details of all existing cookbooks in an environment.Iterable<? extends Environment> Lists the details of all existing environments.Lists the details of all existing nodes.listNodes(ExecutorService executorService) Lists the details of all existing nodes, executing concurrently using the executorService.listNodesInEnvironment(String environmentName) Lists the details of all existing nodes in the given environment.listNodesInEnvironment(String environmentName, ExecutorService executorService) Lists the details of all existing nodes in the given environment, using the ExecutorService to paralleling the execution.voidupdateAutomaticAttributesOnNode(String nodeName) Updates and populate the automatic attributes of the given node.voidupdateBootstrapConfigForGroup(String group, BootstrapConfig bootstrapConfig) Configures how the nodes of a certain group will be bootstrapped
-
Field Details
-
logger
-
-
Method Details
-
encrypt
Description copied from interface:ChefServiceEncrypts the given input stream.- Specified by:
encryptin interfaceChefService- Parameters:
input- 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
Description copied from interface:ChefServiceDecrypts the given input stream.- Specified by:
decryptin interfaceChefService- Parameters:
input- 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
Description copied from interface:ChefServiceCreates all steps necessary to bootstrap the node.- Specified by:
createBootstrapScriptForGroupin interfaceChefService- Parameters:
group- corresponds to a configuredChefProperties.CHEF_BOOTSTRAP_DATABAGdata bag where run_list and other information are stored.nodeName- The name of the node to create.- Returns:
- The script used to bootstrap the node.
-
createBootstrapScriptForGroup
Description copied from interface:ChefServiceCreates all steps necessary to bootstrap the node.- Specified by:
createBootstrapScriptForGroupin interfaceChefService- Parameters:
group- corresponds to a configuredChefProperties.CHEF_BOOTSTRAP_DATABAGdata bag where run_list and other information are stored.- Returns:
- The script used to bootstrap the node.
-
updateBootstrapConfigForGroup
Description copied from interface:ChefServiceConfigures how the nodes of a certain group will be bootstrapped- Specified by:
updateBootstrapConfigForGroupin interfaceChefService- Parameters:
group- The group where the given bootstrap configuration will be applied.bootstrapConfig- The configuration to be applied to the nodes in the group.
-
getBootstrapConfigForGroup
Description copied from interface:ChefServiceGets the bootstrap configuration for a given group.- Specified by:
getBootstrapConfigForGroupin interfaceChefService- Parameters:
group- The name of the group.- Returns:
- The bootstrap configuration for the given group.
-
cleanupStaleNodesAndClients
Description copied from interface:ChefServiceRemoves the nodes and clients that have been inactive for a given amount of time.- Specified by:
cleanupStaleNodesAndClientsin interfaceChefService- Parameters:
prefix- The prefix for the nodes and clients to delete.secondsStale- The seconds of inactivity to consider a node and client obsolete.
-
createNodeAndPopulateAutomaticAttributes
Description copied from interface:ChefServiceCreates a new node and populates the automatic attributes.- Specified by:
createNodeAndPopulateAutomaticAttributesin interfaceChefService- 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:
-
updateAutomaticAttributesOnNode
Description copied from interface:ChefServiceUpdates and populate the automatic attributes of the given node.- Specified by:
updateAutomaticAttributesOnNodein interfaceChefService- Parameters:
nodeName- The node to update.
-
deleteAllNodesInList
Description copied from interface:ChefServiceDeletes the given nodes.- Specified by:
deleteAllNodesInListin interfaceChefService- Parameters:
names- The names of the nodes to delete.
-
deleteAllClientsInList
Description copied from interface:ChefServiceDeletes the given clients.- Specified by:
deleteAllClientsInListin interfaceChefService- Parameters:
names- The names of the client to delete.
-
listNodes
Description copied from interface:ChefServiceLists the details of all existing nodes.- Specified by:
listNodesin interfaceChefService- Returns:
- The details of all existing nodes.
-
listNodes
Description copied from interface:ChefServiceLists the details of all existing nodes, executing concurrently using the executorService.- Specified by:
listNodesin interfaceChefService- Returns:
- The details of all existing nodes.
-
listClients
Description copied from interface:ChefServiceLists the details of all existing clients.- Specified by:
listClientsin interfaceChefService- Returns:
- The details of all existing clients.
-
listClients
Description copied from interface:ChefServiceLists the details of all existing clients, but executing concurrently using the threads available in the ExecutorService.- Specified by:
listClientsin interfaceChefService- Returns:
- The details of all existing clients.
-
listCookbookVersions
Description copied from interface:ChefServiceLists the details of all existing cookbooks.- Specified by:
listCookbookVersionsin interfaceChefService- Returns:
- The details of all existing cookbooks.
-
listCookbookVersions
Description copied from interface:ChefServiceLists the details of all existing cookbooks. This method is executed concurrently, using the threads available in the ExecutorService.- Specified by:
listCookbookVersionsin interfaceChefService- Returns:
- The details of all existing cookbooks.
-
listCookbookVersionsInEnvironment
public Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName) Description copied from interface:ChefServiceLists the details of all existing cookbooks in an environment.- Specified by:
listCookbookVersionsInEnvironmentin interfaceChefService- Parameters:
environmentName- The environment name.- Returns:
- The details of all existing cookbooks in an environment.
-
listCookbookVersionsInEnvironment
public Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName, ExecutorService executorService) Description copied from interface:ChefServiceLists the details of all existing cookbooks in an environment.- Specified by:
listCookbookVersionsInEnvironmentin interfaceChefService- Parameters:
environmentName- The environment name.executorService- The thread pool to do the concurrent execution.- Returns:
- The details of all existing cookbooks in an environment.
-
listCookbookVersionsInEnvironment
public Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName, String numVersions) Description copied from interface:ChefServiceLists the details of all existing cookbooks in an environment limiting number of versions.- Specified by:
listCookbookVersionsInEnvironmentin interfaceChefService- 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
public Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName, String numVersions, ExecutorService executorService) Description copied from interface:ChefServiceLists the details of all existing cookbooks in an environment limiting number of versions.- Specified by:
listCookbookVersionsInEnvironmentin interfaceChefService- Parameters:
environmentName- The environment name.numVersions- The number of cookbook versions to include. Use 'all' to return all cookbook versions.executorService- The executorService used to do this operation concurrently.- Returns:
- The details of all existing cookbooks in environment.
-
listEnvironments
Description copied from interface:ChefServiceLists the details of all existing environments.- Specified by:
listEnvironmentsin interfaceChefService- Returns:
- The details of all existing environments.
-
listNodesInEnvironment
Description copied from interface:ChefServiceLists the details of all existing nodes in the given environment.- Specified by:
listNodesInEnvironmentin interfaceChefService- Parameters:
environmentName- The name fo the environment.- Returns:
- The details of all existing nodes in the given environment.
-
listNodesInEnvironment
public Iterable<? extends Node> listNodesInEnvironment(String environmentName, ExecutorService executorService) Description copied from interface:ChefServiceLists the details of all existing nodes in the given environment, using the ExecutorService to paralleling the execution.- Specified by:
listNodesInEnvironmentin interfaceChefService- Parameters:
environmentName- The name fo the environment.executorService- The thread pool used in this operation- Returns:
- The details of all existing nodes in the given environment.
-