I currently work for a company called Pure Storage. One of their products is called Flashblade. I couldn’t find any examples on how to use Flashblade’s S3 capabilities programmatically anywhere online, so I’m putting this out to hopefully help people realize they can move their object store into their data center with very little changes to their code.
Code Snippets
Most of the work with the libraries I’ve used involves figuring out how to get the client configured properly. Once that’s done, all of the methods work just like they do with Amazon S3.
Python (w/ boto3)
def get_fb_s3_client(access_key, secret_key, endpoint):
return boto3.client(
's3',
aws_access_key_id=access_key,
aws_secret_access_key=secret_key,
endpoint_url=endpoint
)
client = get_fb_s3_client('<REDACTED>', '<REDACTED>', 'http://10.86.75.30')
Java (w/ AWS sdk)
public static AmazonS3 getFlashbladeS3Client(String accessKey, String secretKey, String endpoint) {
AwsClientBuilder.EndpointConfiguration endpointConfig = new AwsClientBuilder.EndpointConfiguration(endpoint, "");
BasicAWSCredentials awsCredentials = new BasicAWSCredentials(accessKey, secretKey);
AWSStaticCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(awsCredentials);
return AmazonS3ClientBuilder.standard()
.withEndpointConfiguration(endpointConfig)
.withCredentials(credentialsProvider)
.build();
}
AmazonS3 client = getFlashbladeS3Client("<REDACTED>", "<REDACTED>", "http://10.24.60.1");