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();
}
Aggregations