jclouds

Bootstrap chef node with Jclouds

 ̄綄美尐妖づ 提交于 2019-12-25 03:53:30
问题 i'm using the Jclouds library to bootstrap my Vms instead of used "knife bootstrap" , i find the following code package com.sagemcom.administration.chef; import java.io.File; import java.io.IOException; import java.util.List; import java.util.Properties; import org.jclouds.Constants; import org.jclouds.ContextBuilder; import org.jclouds.chef.ChefContext; import org.jclouds.chef.ChefService; import org.jclouds.chef.config.ChefProperties; import org.jclouds.chef.domain.BootstrapConfig; import

Cinder API using jclouds

為{幸葍}努か 提交于 2019-12-25 02:56:12
问题 I have been reading about the support jclouds added to the Cinder Openstack API, and i was looking at this example usage on Rackspace Cloud. https://github.com/jclouds/jclouds-examples/blob/master/rackspace/src/main/java/org/jclouds/examples/rackspace/cloudblockstorage/CreateVolumeAndAttach.java does anybody know is this is supported for HP Cloud as well? if not, how can i use HP Cloud Block Storage with jclouds? thanks a lot! 回答1: You should be able to use the Cinder API with HP but I tried

jclouds with OpenStack => java.util.NoSuchElementException: apiType compute not found in catalog []

孤街浪徒 提交于 2019-12-24 15:23:07
问题 Java jclouds API fails to connect to an OpenStack provider. Exception is thrown with the following message: java.util.NoSuchElementException: apiType compute not found in catalog []. Other APIs (python-novaclient, ruby-fog) work just fine, so the problem looks language (API)-specific. import static com.google.common.io.Closeables.closeQuietly; import java.io.Closeable; import java.util.Set; import org.jclouds.ContextBuilder; import org.jclouds.compute.ComputeService; import org.jclouds

JClouds-Chef: IllegalAccessError on TokenType2?

守給你的承諾、 提交于 2019-12-24 12:25:06
问题 I am using the JClouds-Chef API to bootstrap a Linux VM ( myapp01.me.example.com ) with Chef Client, and to then run the client and configure the VM with its app stack via a typicalapp role: package com.me.myorg.chef; import org.jclouds.Constants import org.jclouds.ContextBuilder import org.jclouds.chef.ChefContext import org.jclouds.chef.ChefService import org.jclouds.chef.config.ChefProperties import org.jclouds.chef.domain.BootstrapConfig import org.jclouds.chef.util.RunListBuilder import

How to upload file to S3 from GAE (a horror story)

允我心安 提交于 2019-12-23 22:18:13
问题 I am trying to upload a file to amazon S3 from GAE. I tried the official amazon sdk (jetS3t, built on top of the lower-level sdk), just to find out that even if you can get it to work locally by setting permissions on the local JVM it is not supported for GAE crypto-related reasons once you deploy it. Then out of desperation I found that some good soul forked the official low-level amazon sdk so that it would work with GAE. This kind of works (even though I can see some strage NullPointer

Error creating BlobContext using jclouds in a Spring MVC application

倾然丶 夕夏残阳落幕 提交于 2019-12-13 14:41:50
问题 I have a Spring MVC 4.0.1 web application that needs to upload files to Rackspace Cloud Files. I am using Apache jClouds in order to do this. When trying to create the BlobStore using the following code: BlobStoreContext context = ContextBuilder.newBuilder("cloudfiles-us").credentials("username","password").buildView(BlobStoreContext.class); I get the following exception: com.google.inject.CreationException: Guice creation errors: 1) No implementation for com.google.common.base.Supplier<java

Using AWS (S3) via jclouds - how to assume role

不羁的心 提交于 2019-12-12 20:38:24
问题 When using plain auth credentials I can do: ContextBuilder.newBuilder("aws-s3").credentials(keyId, key).buildView(BlobStoreContext.class); ... to access BlobStoreContext for S3. In native Amazon java api I can use Security Token Service (STS) to assume role and use temporary credentials to access S3 or any other AWS service. How do I do this in jclouds? 回答1: I figured it out. This code snippet allows to assume role and use temp credentials to access S3: STSApi api = ContextBuilder.newBuilder(

Java - java.lang.NoClassDefFoundError: com/google/inject/internal/util/$Preconditions

柔情痞子 提交于 2019-12-12 13:52:39
问题 I'm working on an extension for druid that uses jclouds for Rackspace Cloud Files and I encountered a problem with Google guice and I'm not very confident with Java. I already saw this question, but it doesn't seem that there's a conflict in guice versions. This is the code that is being executed: @Provides @LazySingleton public CloudFilesApi getCloudFilesApi(final CloudFilesAccountConfig config) { log.info("Provider: " + config.getProvider()); log.info("Username: " + config.getUserName());

how to assign network to vm using jclouds in openstack and How to list all networks in Openstack using Jclouds

断了今生、忘了曾经 提交于 2019-12-12 03:55:35
问题 Can someone help me understanding how to assign a specific network to a newly created VM using the JClouds API in OpenStack? I'm using following code to create the real server: CreateServerOptions[] serverOptions = new CreateServerOptions[0]; ServerCreated serverCreated = serverApi.create(clonedVmName, imageId, FlavourId, serverOptions); Also I'm using v1.0-quantum APIs to fetch all the networks as follows but it's not returning any. I'm not sure what's wrong with the following code: Iterable

JClouds-Chef not bootstrapping & configuring VM

佐手、 提交于 2019-12-12 02:55:15
问题 I am trying to get the following JClouds-Chef code (v1.7.3) to bootstrap Chef Client on a brand new Linux VM and then execute a run list to actually configure that VM with an app stack ( typical_app ): public class ChefPlugin { public static void main(String[] args) { ChefPlugin.provision(); System.out.println("And done!"); System.exit(0); } public static provision() { String vmIp = "myapp01"; String vmSshUsername = "myadmin"; String vmSshPassword = "12345"; String endpoint = "https:/