Search in sources :

Example 31 with ComputeServiceContext

use of org.jclouds.compute.ComputeServiceContext in project iobserve-analysis by research-iobserve.

the class AbstractActionScript method getComputeServiceForContainer.

/**
 * Returns a compute service client to use for further queries to the cloud provider.
 *
 * @param container
 *            the resource container for which to get the compute service
 * @return the corresponding compute service
 */
protected ComputeService getComputeServiceForContainer(final ResourceContainerCloud container) {
    final CloudProvider provider = container.getInstanceType().getProvider();
    final ComputeServiceContext context = ContextBuilder.newBuilder(provider.getName()).credentials(provider.getIdentity(), provider.getCredential()).modules(// NOCS
    ImmutableSet.<Module>of(new SLF4JLoggingModule(), new SshjSshClientModule())).buildView(ComputeServiceContext.class);
    return context.getComputeService();
}
Also used : SLF4JLoggingModule(org.jclouds.logging.slf4j.config.SLF4JLoggingModule) CloudProvider(org.palladiosimulator.pcm.cloud.pcmcloud.cloudprofile.CloudProvider) SshjSshClientModule(org.jclouds.sshj.config.SshjSshClientModule) ComputeServiceContext(org.jclouds.compute.ComputeServiceContext) Module(com.google.inject.Module) SLF4JLoggingModule(org.jclouds.logging.slf4j.config.SLF4JLoggingModule) SshjSshClientModule(org.jclouds.sshj.config.SshjSshClientModule)

Aggregations

ComputeServiceContext (org.jclouds.compute.ComputeServiceContext)31 ComputeService (org.jclouds.compute.ComputeService)13 Module (com.google.inject.Module)9 Template (org.jclouds.compute.domain.Template)9 TemplateBuilder (org.jclouds.compute.domain.TemplateBuilder)9 Properties (java.util.Properties)8 SshjSshClientModule (org.jclouds.sshj.config.SshjSshClientModule)7 ClusterSpec (org.apache.whirr.ClusterSpec)6 NodeMetadata (org.jclouds.compute.domain.NodeMetadata)6 IOException (java.io.IOException)5 Set (java.util.Set)5 SLF4JLoggingModule (org.jclouds.logging.slf4j.config.SLF4JLoggingModule)5 ImmutableSet (com.google.common.collect.ImmutableSet)4 HashSet (java.util.HashSet)4 Stack (java.util.Stack)4 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)4 CompositeConfiguration (org.apache.commons.configuration.CompositeConfiguration)4 Configuration (org.apache.commons.configuration.Configuration)4 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)4 InstanceTemplate (org.apache.whirr.InstanceTemplate)4