Comments (4)
See how ceph support the same S3 api but with different endpoint
<?php
define('AWS_KEY', 'place access key here');
define('AWS_SECRET_KEY', 'place secret key here');
define('AWS_CANONICAL_ID', 'your DHO Username');
define('AWS_CANONICAL_NAME', 'Also your DHO Username!');
$HOST = 'objects.dreamhost.com';
// require the amazon sdk for php library
require_once 'AWSSDKforPHP/sdk.class.php';
// Instantiate the S3 class and point it at the desired host
$Connection = new AmazonS3(array(
'key' => AWS_KEY,
'secret' => AWS_SECRET_KEY,
'canonical_id' => AWS_CANONICAL_ID,
'canonical_name' => AWS_CANONICAL_NAME,
));
$Connection->set_hostname($HOST);
$Connection->allow_hostname_override(false);
// Set the S3 class to use objects.dreamhost.com/bucket
// instead of bucket.objects.dreamhost.com
$Connection->enable_path_style();
//buckets
$ListResponse = $Connection->list_buckets();
$Buckets = $ListResponse->body->Buckets->Bucket;
foreach ($Buckets as $Bucket) {
echo $Bucket->Name . "\t" . $Bucket->CreationDate . "\n";
}
//Create
$Connection->create_bucket('my-new-bucket', AmazonS3::REGION_US_E1);
//Objects
$ObjectsListResponse = $Connection->list_objects($bucketname);
$Objects = $ObjectsListResponse->body->Contents;
foreach ($Objects as $Object) {
echo $Object->Key . "\t" . $Object->Size . "\t" . $Object->LastModified . "\n";
}
from vibe-s3.
Minio in particular https://www.minio.io/
from vibe-s3.
hi @aberba
can you submit a PR for that? it should be reasonably easy to fix. i currently lack the time to test this.
from vibe-s3.
Before that, the api has ti be configured to either use secure connection (https) or insecure(http). Plus some kind of forcePath.
Will study the logic further to see if removing the https:// part will not break code.
from vibe-s3.
Related Issues (13)
- uploading bigger file fails HOT 5
- region as enum? HOT 1
- use requests HOT 1
- range interface HOT 2
- multi-part upload HOT 4
- Error compiling on Ubuntu 14.04 x86, DMD32 D Compiler v2.072.1 HOT 1
- Making s3 endPoint configurable in s3.d
- Example for file uploads (single and multipart)
- behaviour if streaming upload fails
- object life cycle config
- Very recent vibe-d dependency HOT 1
- Compilation Error using dmd 2.073.0 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vibe-s3.