Skip to content

Instantly share code, notes, and snippets.

@connormanning
Created June 27, 2018 17:00
Show Gist options
  • Save connormanning/8a1157306c51f315b6403807f0926541 to your computer and use it in GitHub Desktop.
Save connormanning/8a1157306c51f315b6403807f0926541 to your computer and use it in GitHub Desktop.
Minio arbiter
{
"partitions": [
{
"defaults": {
"hostname": "{service}.{region}.{dnsSuffix}",
"protocols": [
"https"
],
"signatureVersions": [
"v4"
]
},
"dnsSuffix": "amazonaws.com",
"partition": "aws",
"partitionName": "AWS Standard",
"regionRegex": "^(us|eu|ap|sa|ca)\\-\\w+\\-\\d+$",
"regions": {
"ap-northeast-1": {
"description": "Asia Pacific (Tokyo)"
},
"ap-northeast-2": {
"description": "Asia Pacific (Seoul)"
},
"ap-south-1": {
"description": "Asia Pacific (Mumbai)"
},
"ap-southeast-1": {
"description": "Asia Pacific (Singapore)"
},
"ap-southeast-2": {
"description": "Asia Pacific (Sydney)"
},
"ca-central-1": {
"description": "Canada (Central)"
},
"eu-central-1": {
"description": "EU (Frankfurt)"
},
"eu-west-1": {
"description": "EU (Ireland)"
},
"eu-west-2": {
"description": "EU (London)"
},
"sa-east-1": {
"description": "South America (Sao Paulo)"
},
"us-east-1": {
"description": "US East (N. Virginia)"
},
"us-east-2": {
"description": "US East (Ohio)"
},
"us-west-1": {
"description": "US West (N. California)"
},
"us-west-2": {
"description": "US West (Oregon)"
}
},
"services": {
"s3": {
"defaults": {
"protocols": [
"http",
"https"
],
"signatureVersions": [
"s3v4"
]
},
"endpoints": {
"minio": {
"hostname": "localhost",
"signatureVersions": [
"s3v4"
]
},
"ap-northeast-1": {
"hostname": "s3-ap-northeast-1.amazonaws.com",
"signatureVersions": [
"s3",
"s3v4"
]
},
"ap-northeast-2": {},
"ap-south-1": {},
"ap-southeast-1": {
"hostname": "s3-ap-southeast-1.amazonaws.com",
"signatureVersions": [
"s3",
"s3v4"
]
},
"ap-southeast-2": {
"hostname": "s3-ap-southeast-2.amazonaws.com",
"signatureVersions": [
"s3",
"s3v4"
]
},
"ca-central-1": {},
"eu-central-1": {},
"eu-west-1": {
"hostname": "s3-eu-west-1.amazonaws.com",
"signatureVersions": [
"s3",
"s3v4"
]
},
"eu-west-2": {},
"s3-external-1": {
"credentialScope": {
"region": "us-east-1"
},
"hostname": "s3-external-1.amazonaws.com",
"signatureVersions": [
"s3",
"s3v4"
]
},
"sa-east-1": {
"hostname": "s3-sa-east-1.amazonaws.com",
"signatureVersions": [
"s3",
"s3v4"
]
},
"us-east-1": {
"hostname": "s3.amazonaws.com",
"signatureVersions": [
"s3",
"s3v4"
]
},
"us-east-2": {},
"us-west-1": {
"hostname": "s3-us-west-1.amazonaws.com",
"signatureVersions": [
"s3",
"s3v4"
]
},
"us-west-2": {
"hostname": "s3-us-west-2.amazonaws.com",
"signatureVersions": [
"s3",
"s3v4"
]
}
},
"isRegionalized": true,
"partitionEndpoint": "us-east-1"
}
}
},
{
"defaults": {
"hostname": "{service}.{region}.{dnsSuffix}",
"protocols": [
"https"
],
"signatureVersions": [
"v4"
]
},
"dnsSuffix": "amazonaws.com.cn",
"partition": "aws-cn",
"partitionName": "AWS China",
"regionRegex": "^cn\\-\\w+\\-\\d+$",
"regions": {
"cn-north-1": {
"description": "China (Beijing)"
}
},
"services": {
"s3": {
"defaults": {
"protocols": [
"http",
"https"
],
"signatureVersions": [
"s3v4"
]
},
"endpoints": {
"cn-north-1": {}
}
}
}
},
{
"defaults": {
"hostname": "{service}.{region}.{dnsSuffix}",
"protocols": [
"https"
],
"signatureVersions": [
"v4"
]
},
"dnsSuffix": "amazonaws.com",
"partition": "aws-us-gov",
"partitionName": "AWS GovCloud (US)",
"regionRegex": "^us\\-gov\\-\\w+\\-\\d+$",
"regions": {
"us-gov-west-1": {
"description": "AWS GovCloud (US)"
}
},
"services": {
"s3": {
"defaults": {
"signatureVersions": [
"s3",
"s3v4"
]
},
"endpoints": {
"fips-us-gov-west-1": {
"credentialScope": {
"region": "us-gov-west-1"
},
"hostname": "s3-fips-us-gov-west-1.amazonaws.com"
},
"us-gov-west-1": {
"hostname": "s3-us-gov-west-1.amazonaws.com",
"protocols": [
"http",
"https"
]
}
}
}
}
}
],
"version": 3
}
#include <iostream>
#include <arbiter/arbiter.hpp>
int main()
{
Json::Value json;
json["s3"]["profile"] = "minio";
json["s3"]["region"] = "minio";
json["s3"]["access"] = "2H34YBMWKL0IJX8PIYHW";
json["s3"]["secret"] = "opewLFRQRZxNST5eCHMTK6iuuHdICppcLtTCZYlb";
arbiter::Arbiter a(json);
a.put("minio@s3://asdf/test.txt", "Testing");
std::cout << a.get("minio@s3://asdf/test.txt") << std::endl;
}
# Put endpoints.json into ~/.aws/endpoints.json
g++ -std=c++11 minio.cpp -larbiter -o minio
CURL_VERBOSE=1 ./minio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment