Last active
August 29, 2015 14:03
-
-
Save etoews/9129de9c83fefd721316 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.common.collect.ImmutableSet; | |
import com.google.inject.Module; | |
import org.jclouds.ContextBuilder; | |
import org.jclouds.blobstore.BlobStore; | |
import org.jclouds.logging.slf4j.config.SLF4JLoggingModule; | |
import org.jclouds.openstack.swift.v1.blobstore.RegionScopedBlobStoreContext; | |
import org.jclouds.rackspace.cloudfiles.v1.CloudFilesApi; | |
import java.io.IOException; | |
public class Test { | |
public static void main(String[] args) throws IOException { | |
Iterable<Module> modules = ImmutableSet.<Module>of( | |
new SLF4JLoggingModule()); | |
ContextBuilder builder = ContextBuilder.newBuilder("rackspace-cloudfiles-uk") | |
.modules(modules) | |
.endpoint("https://lon.identity.api.rackspacecloud.com/v2.0/") | |
.credentials("uk_username", "uk_apikey"); | |
BlobStore blobStore = builder.buildView(RegionScopedBlobStoreContext.class).blobStoreInRegion("LON"); | |
CloudFilesApi cloudFilesApi = blobStore.getContext().unwrapApi(CloudFilesApi.class); | |
System.out.println("cloudFilesApi.getConfiguredRegions() = " + cloudFilesApi.getConfiguredRegions()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment