@Singleton public class BaseChefService extends Object implements ChefService
Modifier and Type | Method and Description |
---|---|
void |
cleanupStaleNodesAndClients(String prefix,
int secondsStale)
Removes the nodes and clients that have been inactive for a given amount of
time.
|
Statement |
createBootstrapScriptForGroup(String group)
Creates all steps necessary to bootstrap the node.
|
Statement |
createBootstrapScriptForGroup(String group,
String nodeName)
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(InputStream input)
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(InputStream input)
Encrypts the given input stream.
|
BootstrapConfig |
getBootstrapConfigForGroup(String group)
Gets the bootstrap configuration for a 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
|
@Named(value="jclouds.chef") protected Logger logger
public byte[] encrypt(InputStream input) throws IOException
ChefService
encrypt
in interface ChefService
input
- The input stream to encrypt.IOException
- If there is an error reading from the input stream.public byte[] decrypt(InputStream input) throws IOException
ChefService
decrypt
in interface ChefService
input
- The input stream to decrypt.IOException
- If there is an error reading from the input stream.public Statement createBootstrapScriptForGroup(String group, @Nullable String nodeName)
ChefService
createBootstrapScriptForGroup
in interface ChefService
group
- corresponds to a configured
ChefProperties.CHEF_BOOTSTRAP_DATABAG
data bag where
run_list and other information are stored.nodeName
- The name of the node to create.public Statement createBootstrapScriptForGroup(String group)
ChefService
createBootstrapScriptForGroup
in interface ChefService
group
- corresponds to a configured
ChefProperties.CHEF_BOOTSTRAP_DATABAG
data bag where
run_list and other information are stored.public void updateBootstrapConfigForGroup(String group, BootstrapConfig bootstrapConfig)
ChefService
updateBootstrapConfigForGroup
in interface ChefService
group
- The group where the given bootstrap configuration will be
applied.bootstrapConfig
- The configuration to be applied to the nodes in the
group.public BootstrapConfig getBootstrapConfigForGroup(String group)
ChefService
getBootstrapConfigForGroup
in interface ChefService
group
- The name of the group.public void cleanupStaleNodesAndClients(String prefix, int secondsStale)
ChefService
cleanupStaleNodesAndClients
in interface ChefService
prefix
- The prefix for the nodes and clients to delete.secondsStale
- The seconds of inactivity to consider a node and
client obsolete.public Node createNodeAndPopulateAutomaticAttributes(String nodeName, Iterable<String> runList)
ChefService
createNodeAndPopulateAutomaticAttributes
in interface ChefService
nodeName
- The name of the node to create.runList
- The run list for the created node.OhaiModule
,
ChefUtils.ohaiAutomaticAttributeBinder(com.google.inject.Binder)
public void updateAutomaticAttributesOnNode(String nodeName)
ChefService
updateAutomaticAttributesOnNode
in interface ChefService
nodeName
- The node to update.public void deleteAllNodesInList(Iterable<String> names)
ChefService
deleteAllNodesInList
in interface ChefService
names
- The names of the nodes to delete.public void deleteAllClientsInList(Iterable<String> names)
ChefService
deleteAllClientsInList
in interface ChefService
names
- The names of the client to delete.public Iterable<? extends Node> listNodes()
ChefService
listNodes
in interface ChefService
public Iterable<? extends Node> listNodes(ExecutorService executorService)
ChefService
listNodes
in interface ChefService
public Iterable<? extends Client> listClients()
ChefService
listClients
in interface ChefService
public Iterable<? extends Client> listClients(ExecutorService executorService)
ChefService
listClients
in interface ChefService
public Iterable<? extends CookbookVersion> listCookbookVersions()
ChefService
listCookbookVersions
in interface ChefService
public Iterable<? extends CookbookVersion> listCookbookVersions(ExecutorService executorService)
ChefService
listCookbookVersions
in interface ChefService
public Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName)
ChefService
listCookbookVersionsInEnvironment
in interface ChefService
environmentName
- The environment name.public Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName, ExecutorService executorService)
ChefService
listCookbookVersionsInEnvironment
in interface ChefService
environmentName
- The environment name.executorService
- The thread pool to do the concurrent execution.public Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName, String numVersions)
ChefService
listCookbookVersionsInEnvironment
in interface ChefService
environmentName
- The environment name.numVersions
- The number of cookbook versions to include.
Use 'all' to return all cookbook versions.public Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName, String numVersions, ExecutorService executorService)
ChefService
listCookbookVersionsInEnvironment
in interface ChefService
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.public Iterable<? extends Environment> listEnvironments()
ChefService
listEnvironments
in interface ChefService
public Iterable<? extends Node> listNodesInEnvironment(String environmentName)
ChefService
listNodesInEnvironment
in interface ChefService
environmentName
- The name fo the environment.public Iterable<? extends Node> listNodesInEnvironment(String environmentName, ExecutorService executorService)
ChefService
listNodesInEnvironment
in interface ChefService
environmentName
- The name fo the environment.executorService
- The thread pool used in this operationCopyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.