|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jclouds.chef.internal.BaseChefService
@Singleton public class BaseChefService
| Field Summary | |
|---|---|
protected org.jclouds.logging.Logger |
logger
|
| Constructor Summary | |
|---|---|
protected |
BaseChefService(ChefContext chefContext,
ChefApi api,
CleanupStaleNodesAndClients cleanupStaleNodesAndClients,
CreateNodeAndPopulateAutomaticAttributes createNodeAndPopulateAutomaticAttributes,
DeleteAllNodesInList deleteAllNodesInList,
ListNodes listNodes,
DeleteAllClientsInList deleteAllClientsInList,
ListClients listClients,
ListCookbookVersions listCookbookVersions,
UpdateAutomaticAttributesOnNode updateAutomaticAttributesOnNode,
com.google.common.base.Supplier<PrivateKey> privateKey,
String databag,
GroupToBootScript groupToBootScript,
BootstrapConfigForGroup bootstrapConfigForGroup,
RunListForGroup runListForGroup,
ListEnvironments listEnvironments,
ListNodesInEnvironment listNodesInEnvironment,
ListCookbookVersionsInEnvironment listCookbookVersionsInEnvironment,
org.jclouds.json.Json json,
org.jclouds.crypto.Crypto crypto)
|
| 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@Named(value="jclouds.chef") protected org.jclouds.logging.Logger logger
| Constructor Detail |
|---|
@Inject
protected BaseChefService(ChefContext chefContext,
ChefApi api,
CleanupStaleNodesAndClients cleanupStaleNodesAndClients,
CreateNodeAndPopulateAutomaticAttributes createNodeAndPopulateAutomaticAttributes,
DeleteAllNodesInList deleteAllNodesInList,
ListNodes listNodes,
DeleteAllClientsInList deleteAllClientsInList,
ListClients listClients,
ListCookbookVersions listCookbookVersions,
UpdateAutomaticAttributesOnNode updateAutomaticAttributesOnNode,
com.google.common.base.Supplier<PrivateKey> privateKey,
@Named(value="chef.bootstrap-databag")
String databag,
GroupToBootScript groupToBootScript,
BootstrapConfigForGroup bootstrapConfigForGroup,
RunListForGroup runListForGroup,
ListEnvironments listEnvironments,
ListNodesInEnvironment listNodesInEnvironment,
ListCookbookVersionsInEnvironment listCookbookVersionsInEnvironment,
org.jclouds.json.Json json,
org.jclouds.crypto.Crypto crypto)
| Method Detail |
|---|
public ChefContext getContext()
ChefService
getContext in interface ChefService
public byte[] encrypt(com.google.common.io.InputSupplier<? extends InputStream> supplier)
throws IOException
ChefService
encrypt in interface ChefServicesupplier - The input stream to encrypt.
IOException - If there is an error reading from the input stream.
public byte[] decrypt(com.google.common.io.InputSupplier<? extends InputStream> supplier)
throws IOException
ChefService
decrypt in interface ChefServicesupplier - The input stream to decrypt.
IOException - If there is an error reading from the input stream.public org.jclouds.scriptbuilder.domain.Statement createBootstrapScriptForGroup(String group)
ChefService
createBootstrapScriptForGroup in interface ChefServicegroup - 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 ChefServicegroup - The group where the given bootstrap configuration will be
applied.bootstrapConfig - The configuration to be applied to the nodes in the
group.public List<String> getRunListForGroup(String group)
ChefService
getRunListForGroup in interface ChefServicepublic org.jclouds.domain.JsonBall getBootstrapConfigForGroup(String group)
ChefService
getBootstrapConfigForGroup in interface ChefServicegroup - The name of the group.
public void cleanupStaleNodesAndClients(String prefix,
int secondsStale)
ChefService
cleanupStaleNodesAndClients in interface ChefServiceprefix - 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 ChefServicenodeName - 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 ChefServicenodeName - The node to update.public void deleteAllNodesInList(Iterable<String> names)
ChefService
deleteAllNodesInList in interface ChefServicenames - The names of the nodes to delete.public void deleteAllClientsInList(Iterable<String> names)
ChefService
deleteAllClientsInList in interface ChefServicenames - The names of the client to delete.public Iterable<? extends Node> listNodes()
ChefService
listNodes in interface ChefServicepublic Iterable<? extends Node> listNodes(ExecutorService executorService)
ChefService
listNodes in interface ChefServicepublic Iterable<? extends Client> listClients()
ChefService
listClients in interface ChefServicepublic Iterable<? extends Client> listClients(ExecutorService executorService)
ChefService
listClients in interface ChefServicepublic Iterable<? extends CookbookVersion> listCookbookVersions()
ChefService
listCookbookVersions in interface ChefServicepublic Iterable<? extends CookbookVersion> listCookbookVersions(ExecutorService executorService)
ChefService
listCookbookVersions in interface ChefServicepublic Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName)
ChefService
listCookbookVersionsInEnvironment in interface ChefServiceenvironmentName - The environment name.
public Iterable<? extends CookbookVersion> listCookbookVersionsInEnvironment(String environmentName,
ExecutorService executorService)
ChefService
listCookbookVersionsInEnvironment in interface ChefServiceenvironmentName - 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 ChefServiceenvironmentName - 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 ChefServiceenvironmentName - 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 ChefServicepublic Iterable<? extends Node> listNodesInEnvironment(String environmentName)
ChefService
listNodesInEnvironment in interface ChefServiceenvironmentName - The name fo the environment.
public Iterable<? extends Node> listNodesInEnvironment(String environmentName,
ExecutorService executorService)
ChefService
listNodesInEnvironment in interface ChefServiceenvironmentName - The name fo the environment.executorService - The thread pool used in this operation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||