If you have an existing application written against the Swift API using Apache jclouds, you can easily reconfigure it to connect to EMC ECS . You will need the following information from your Administrator:
- Your ECS Username
- Your Swift password
- Your ECS endpoint information
When connecting with jclouds, we will be using the "swauth" style of authentication for Swift. In this configuration, your endpoint will generally be in the form of https://<host>/auth. If you are connecting directly to an ECS node, Swift runs on port 9024 for HTTP and 9025 for HTTPS. In those cases, the endpoint would be https://<host>:9025/auth.
Once you have the appropriate information, connecting to Swift is easy:
// Create a BlobStore BlobStoreContext swift = ContextBuilder.newBuilder("swift") .credentials("email@example.com", "password") .endpoint("https://swift.vipr.domain.com/auth") .buildView(BlobStoreContext.class);
If you are connecting directly to an ECS node for testing, the host's SSL certificate will likely be self-signed. You can disable SSL certificate validation with the following properties:
Properties overrides = new Properties(); overrides.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true"); overrides.setProperty(Constants.PROPERTY_RELAX_HOSTNAME, "true");
You then can add the properties to the ContextBuilder:
// Create a BlobStore BlobStoreContext swift = ContextBuilder.newBuilder("swift") .credentials("firstname.lastname@example.org", "password") .endpoint("https://data01.domain.com:9025/auth") .overrides(overrides) .buildView(BlobStoreContext.class);
Note that disabling SSL certificate validation is not suitable for production environments.