Merge pull request #562 from harshavardhana/pr_out_bring_old_documentation_back
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
Mini Copy (C) 2014, 2015 Minio, Inc.
|
||||
Minio Client (C) 2014, 2015 Minio, Inc.
|
||||
|
||||
This product includes software developed at Minio, Inc.
|
||||
(http://minio.io/).
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Mini Copy
|
||||
# Minio Client
|
||||
|
||||
mc - Mini copy command for filesystems and object Storage. "mc" has features to resume partial downloads, progress bar, network reconnect and checksum verification. It is written in golang and released under [Apache license v2](./LICENSE).
|
||||
mc - Minio Client command for filesystems and object Storage. "mc" has features to resume partial downloads, progress bar, network reconnect and checksum verification. It is written in golang and released under [Apache license v2](./LICENSE).
|
||||
|
||||
[](https://godoc.org/github.com/minio-io/mc)
|
||||
[](https://travis-ci.org/minio-io/mc)
|
||||
[](https://travis-ci.org/minio-io/mc)
|
||||
|
||||
## Install from Source
|
||||
|
||||
@@ -18,4 +18,3 @@ mc - Mini copy command for filesystems and object Storage. "mc" has features to
|
||||
## Contribute
|
||||
|
||||
[Contribute to mc](./CONTRIBUTING.md)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Mini Copy (C) 2015 Minio, Inc.
|
||||
# Minio Client (C) 2015 Minio, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy, (C) 2015 Minio, Inc.
|
||||
* Minio Client, (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy, (C) 2015 Minio, Inc.
|
||||
* Minio Client, (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2014, 2015 Minio, Inc.
|
||||
* Minio Client (C) 2014, 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2014, 2015 Minio, Inc.
|
||||
* Minio Client (C) 2014, 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2014, 2015 Minio, Inc.
|
||||
* Minio Client (C) 2014, 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2014, 2015 Minio, Inc.
|
||||
* Minio Client (C) 2014, 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2014, 2015 Minio, Inc.
|
||||
* Minio Client (C) 2014, 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-8
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2014, 2015 Minio, Inc.
|
||||
* Minio Client (C) 2014, 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -239,13 +239,7 @@ EXAMPLES:
|
||||
Name: "update",
|
||||
Usage: "Check for new software updates",
|
||||
Description: "",
|
||||
Action: doUpdateCmd,
|
||||
Flags: []cli.Flag{
|
||||
cli.BoolFlag{
|
||||
Name: "yes, y",
|
||||
Usage: "Download and update local binary",
|
||||
},
|
||||
},
|
||||
Action: runUpdateCmd,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
+38
-30
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -51,35 +51,43 @@ func getRequest(url string) (*http.Request, error) {
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// doUpdateCmd -
|
||||
func doUpdateCmd(ctx *cli.Context) {
|
||||
req, err := getRequest(mcUpdateURL)
|
||||
if err != nil {
|
||||
log.Debug.Println(iodine.New(err, nil))
|
||||
console.Fatalln("Unable to update:", mcUpdateURL)
|
||||
// runUpdateCmd -
|
||||
func runUpdateCmd(ctx *cli.Context) {
|
||||
if !ctx.Args().Present() || ctx.Args().First() == "help" {
|
||||
cli.ShowCommandHelpAndExit(ctx, "update", 1) // last argument is exit code
|
||||
}
|
||||
res, err := http.DefaultTransport.RoundTrip(req)
|
||||
if err != nil {
|
||||
log.Debug.Println(iodine.New(err, nil))
|
||||
console.Fatalln("Unable to retrieve:", mcUpdateURL)
|
||||
}
|
||||
if res.StatusCode != http.StatusOK {
|
||||
msg := fmt.Sprint("Received invalid HTTP status: ", res.StatusCode)
|
||||
log.Debug.Println(iodine.New(errors.New(msg), nil))
|
||||
console.Fatalln(msg)
|
||||
}
|
||||
results := updateResults{}
|
||||
err = json.NewDecoder(res.Body).Decode(&results)
|
||||
if err != nil {
|
||||
log.Debug.Println(iodine.New(err, nil))
|
||||
console.Fatalln("Unable to parse JSON:", mcUpdateURL)
|
||||
}
|
||||
latest, err := time.Parse(time.RFC3339Nano, results.LatestBuild)
|
||||
if err != nil {
|
||||
log.Debug.Println(iodine.New(err, nil))
|
||||
console.Fatalln("Unable to parse update time:", results.LatestBuild)
|
||||
}
|
||||
if latest.After(ctx.App.Compiled) {
|
||||
printUpdateNotify("new", "old")
|
||||
switch ctx.Args().First() {
|
||||
case "check":
|
||||
req, err := getRequest(mcUpdateURL)
|
||||
if err != nil {
|
||||
log.Debug.Println(iodine.New(err, nil))
|
||||
console.Fatalln("Unable to update:", mcUpdateURL)
|
||||
}
|
||||
res, err := http.DefaultTransport.RoundTrip(req)
|
||||
if err != nil {
|
||||
log.Debug.Println(iodine.New(err, nil))
|
||||
console.Fatalln("Unable to retrieve:", mcUpdateURL)
|
||||
}
|
||||
if res.StatusCode != http.StatusOK {
|
||||
msg := fmt.Sprint("Received invalid HTTP status: ", res.StatusCode)
|
||||
log.Debug.Println(iodine.New(errors.New(msg), nil))
|
||||
console.Fatalln(msg)
|
||||
}
|
||||
results := updateResults{}
|
||||
err = json.NewDecoder(res.Body).Decode(&results)
|
||||
if err != nil {
|
||||
log.Debug.Println(iodine.New(err, nil))
|
||||
console.Fatalln("Unable to parse JSON:", mcUpdateURL)
|
||||
}
|
||||
latest, err := time.Parse(time.RFC3339Nano, results.LatestBuild)
|
||||
if err != nil {
|
||||
log.Debug.Println(iodine.New(err, nil))
|
||||
console.Fatalln("Unable to parse update time:", results.LatestBuild)
|
||||
}
|
||||
if latest.After(ctx.App.Compiled) {
|
||||
printUpdateNotify("new", "old")
|
||||
}
|
||||
case "yes":
|
||||
console.Fatalln("Functionality not implemented yet")
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2014, 2015 Minio, Inc.
|
||||
* Minio Client (C) 2014, 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2014, 2015 Minio, Inc.
|
||||
* Minio Client (C) 2014, 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#### access
|
||||
|
||||
```go
|
||||
Name:
|
||||
mc access - Set permissions [public, private, readonly] for buckets and folders.
|
||||
|
||||
USAGE:
|
||||
mc access PERMISSION TARGET [TARGET...]
|
||||
|
||||
EXAMPLES:
|
||||
|
||||
1. Set bucket to "private" on Amazon S3 object storage
|
||||
$ mc access private https://s3.amazonaws.com/burningman2011
|
||||
|
||||
2. Set bucket to "public" on Amazon S3 object storage
|
||||
$ mc access public https://s3.amazonaws.com/shared
|
||||
|
||||
3. Set folder to world readwrite (chmod 777) on local filesystem
|
||||
$ mc access public /shared/Music
|
||||
|
||||
```
|
||||
@@ -0,0 +1,19 @@
|
||||
#### cat
|
||||
|
||||
```go
|
||||
NAME:
|
||||
mc cat - Concantenate objects or files to standard output
|
||||
|
||||
USAGE:
|
||||
mc cat SOURCE
|
||||
|
||||
EXAMPLES:
|
||||
1. Concantenate an object from Amazon S3 object storage to mplayer standard input
|
||||
$ mc cat https://s3.amazonaws.com/jukebox/klingon_opera_aktuh_maylotah.ogg | mplayer -
|
||||
|
||||
2. Concantenate a file from local filesystem to standard output.
|
||||
$ mc cat khitomer-accords.txt
|
||||
|
||||
3. Concantenate multiple files from local filesystem to standard output.
|
||||
$ mc cat *.txt > newfile.txt
|
||||
```
|
||||
@@ -0,0 +1,20 @@
|
||||
#### config
|
||||
|
||||
```go
|
||||
NAME:
|
||||
mc config - Generate configuration "/home/harsha/.mc/config.json" file.
|
||||
|
||||
USAGE:
|
||||
mc config generate
|
||||
|
||||
FLAGS:
|
||||
--alias Add URL aliases into config
|
||||
|
||||
EXAMPLES:
|
||||
1. Generate mc config
|
||||
$ mc config generate
|
||||
|
||||
2. Add alias URLs
|
||||
$ mc config --alias "zek https://s3.amazonaws.com/"
|
||||
|
||||
```
|
||||
@@ -0,0 +1,23 @@
|
||||
#### cp
|
||||
|
||||
```go
|
||||
NAME:
|
||||
mc cp - Copy objects and files
|
||||
|
||||
USAGE:
|
||||
mc cp SOURCE TARGET [TARGET...]
|
||||
|
||||
EXAMPLES:
|
||||
1. Copy an object from Amazon S3 object storage to local fileystem.
|
||||
$ mc cp Music/*.ogg https://s3.amazonaws.com/jukebox/
|
||||
|
||||
2. Copy a bucket recursively from Minio object storage to Amazon S3 object storage
|
||||
$ mc cp http://localhost:9000/photos/burningman2011... https://s3.amazonaws.com/burningman/
|
||||
|
||||
3. Copy a local folder recursively to Minio object storage and Amazon S3 object storage
|
||||
$ mc cp backup/... http://localhost:9000/archive/
|
||||
|
||||
4. Copy an object from Amazon S3 object storage to local filesystem on Windows.
|
||||
$ mc cp s3:documents/2014/... backup/2014
|
||||
|
||||
```
|
||||
@@ -0,0 +1,38 @@
|
||||
#### ls
|
||||
|
||||
```go
|
||||
NAME:
|
||||
mc ls - List files and objects
|
||||
|
||||
USAGE:
|
||||
mc ls TARGET [TARGET...]
|
||||
|
||||
EXAMPLES:
|
||||
1. List objects recursively on Minio object storage
|
||||
$ mc ls http://localhost:9000/backup/...
|
||||
[2015-03-28 12:47:50 PDT] 34MiB 2006-Jan-1/backup.tar.gz
|
||||
[2015-03-31 14:46:33 PDT] 55MiB 2006-Mar-1/backup.tar.gz
|
||||
|
||||
2. List buckets on Amazon S3 object storage
|
||||
$ mc ls https://s3.amazonaws.com/
|
||||
[2015-01-20 15:42:00 PST] 0B rom/
|
||||
[2015-01-15 00:05:40 PST] 0B zek/
|
||||
|
||||
3. List buckets from Amazon S3 object storage and recursively list objects from Minio object storage
|
||||
$ mc ls https://s3.amazonaws.com/ http://localhost:9000/backup/...
|
||||
2015-01-15 00:05:40 PST 0B zek/
|
||||
2015-03-31 14:46:33 PDT 55MiB 2006-Mar-1/backup.tar.gz
|
||||
|
||||
4. List files recursively on local filesystem on Windows
|
||||
$ mc ls C:\Users\Worf\...
|
||||
[2015-03-28 12:47:50 PDT] 11.00MiB Martok\Klingon Council Ministers.pdf
|
||||
[2015-03-31 14:46:33 PDT] 15.00MiB Gowron\Khitomer Conference Details.pdf
|
||||
|
||||
5. List files non recursively on local filesystem
|
||||
$ mc ls /usr/lib/llvm-3.4
|
||||
[2015-04-01 14:57:17 PDT] 12KiB lib/
|
||||
[2015-04-01 14:57:17 PDT] 4.0KiB include/
|
||||
[2015-04-01 14:57:10 PDT] 4.0KiB build/
|
||||
[2015-04-01 14:57:07 PDT] 4.0KiB bin/
|
||||
|
||||
```
|
||||
@@ -0,0 +1,20 @@
|
||||
#### mb
|
||||
|
||||
```go
|
||||
NAME:
|
||||
mc mb - Make a directory or bucket
|
||||
|
||||
USAGE:
|
||||
mc mb TARGET [TARGET...]
|
||||
|
||||
EXAMPLES:
|
||||
1. Create a bucket on Amazon S3 object storage
|
||||
$ mc mb https://s3.amazonaws.com/public-document-store
|
||||
|
||||
2. Create a bucket on Minio object storage
|
||||
$ mc mb http://localhost:9000/mongodb-backup
|
||||
|
||||
3. Create multiple buckets on Amazon S3 object storage and Minio object storage
|
||||
$ mc mb https://s3.amazonaws.com/public-photo-store https://s3.amazonaws.com/public-store http://localhost:9000/mongodb-backup
|
||||
|
||||
```
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
../CONTRIBUTING.md
|
||||
@@ -0,0 +1,61 @@
|
||||
# Minio Client
|
||||
|
||||
mc - Minio Client for S3 Compatible Object Storage released under [Apache license v2](./LICENSE).
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
# go get github.com/minio-io/mc
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Commands
|
||||
```
|
||||
NAME:
|
||||
mc - Minio Client for object storage and filesystems
|
||||
|
||||
USAGE:
|
||||
mc [global flags] command [command flags] [arguments...]
|
||||
|
||||
VERSION:
|
||||
1e2357c0c9cbdb6d5cb46de4c0d9ef28
|
||||
|
||||
BUILD:
|
||||
2015-04-28 10:20:42.810860315 -0700 PDT
|
||||
|
||||
COMMANDS:
|
||||
ls List files and objects
|
||||
cp Copy objects and files
|
||||
cat Concantenate objects or files to standard output
|
||||
mb Make a directory or bucket
|
||||
access Set permissions [public, private, readonly] for buckets and folders.
|
||||
config Generate configuration "/home/harsha/.mc/config.json" file.
|
||||
update Check for new software updates
|
||||
|
||||
GLOBAL FLAGS:
|
||||
--theme "minimal" Choose a console theme from this list [*minimal*, nocolor, white]
|
||||
--debug Enable HTTP tracing
|
||||
--quiet, -q Supress chatty console output
|
||||
--retry "5" Number of retry count
|
||||
--version, -v print the version
|
||||
|
||||
```
|
||||
|
||||
## Contribute
|
||||
|
||||
[Contribute to mc](./contributing.md)
|
||||
|
||||
### Supported platforms
|
||||
|
||||
| Name | Supported |
|
||||
| ------------- | ------------- |
|
||||
| Linux | Yes |
|
||||
| Windows | Yes |
|
||||
| Mac OSX | Yes |
|
||||
|
||||
### Supported architectures
|
||||
|
||||
| Arch | Supported |
|
||||
| ------------- | ------------- |
|
||||
| x86-64 | Yes |
|
||||
@@ -0,0 +1,33 @@
|
||||
'use strict'
|
||||
|
||||
var AWS = require('aws-sdk');
|
||||
|
||||
var config = {
|
||||
accessKeyId: "ECHB22VEKH5I0X4K2T7P",
|
||||
secretAccessKey: "IiqhtimkamPZJtV4J8jztm74LpdTSbn7RUASyPzjje2+pfhLJ7nFRg==",
|
||||
endpoint: "localhost:9000",
|
||||
region: "",
|
||||
sslEnabled: false,
|
||||
s3ForcePathStyle: true,
|
||||
};
|
||||
|
||||
AWS.config.update(config);
|
||||
|
||||
var s3 = new AWS.S3();
|
||||
s3.listBuckets(function(err, data) {
|
||||
if (err) {
|
||||
console.log(err); // an error occurred
|
||||
} else {
|
||||
console.log(data); // successful response
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var params = {
|
||||
Bucket: "docs"
|
||||
};
|
||||
|
||||
s3.listObjects(params, function(err, data) {
|
||||
if (err) console.log(err);
|
||||
else console.log(data);
|
||||
});
|
||||
@@ -0,0 +1,49 @@
|
||||
# Using AWS SDK for Javascript
|
||||
|
||||
## Install
|
||||
|
||||
### In Node.js
|
||||
|
||||
```
|
||||
npm install aws-sdk
|
||||
```
|
||||
|
||||
### Example ``GetService`` and ``ListObjects``
|
||||
|
||||
```
|
||||
'use strict'
|
||||
|
||||
var AWS = require('aws-sdk');
|
||||
|
||||
var config = {
|
||||
accessKeyId: "ECHB22VEKH5I0X4K2T7P",
|
||||
secretAccessKey: "IiqhtimkamPZJtV4J8jztm74LpdTSbn7RUASyPzjje2+pfhLJ7nFRg==",
|
||||
endpoint: "localhost:9000",
|
||||
region: "",
|
||||
sslEnabled: false,
|
||||
s3ForcePathStyle: true,
|
||||
};
|
||||
|
||||
AWS.config.update(config);
|
||||
|
||||
var s3 = new AWS.S3();
|
||||
s3.listBuckets(function(err, data) {
|
||||
if (err) {
|
||||
console.log(err); // an error occurred
|
||||
} else {
|
||||
console.log(data); // successful response
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var params = {
|
||||
Bucket: "docs"
|
||||
};
|
||||
|
||||
s3.listObjects(params, function(err, data) {
|
||||
if (err) console.log(err);
|
||||
else console.log(data);
|
||||
});
|
||||
```
|
||||
|
||||
Grab it here [example-list.js](https://github.com/Minio-io/mc/blob/master/docs/sdks/js/example-list.js)
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import boto3
|
||||
s3 = boto3.resource('s3', use_ssl=False, endpoint_url="http://localhost:9000")
|
||||
for bucket in s3.buckets.all():
|
||||
print(bucket.name)
|
||||
@@ -0,0 +1,34 @@
|
||||
# Using AWS SDK for Python
|
||||
|
||||
## Install
|
||||
|
||||
### In Python 2.6, 2.7, 3.3, 3.4
|
||||
|
||||
**WARNING**: Boto 3 is in *developer preview* and **should not** be used in production yet!
|
||||
|
||||
```
|
||||
pip install boto3
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
Next, set up credentials (in e.g. ``~/.aws/credentials``)::
|
||||
|
||||
[default]
|
||||
aws_access_key_id = YOUR_MINIO_ACCESS_ID
|
||||
aws_secret_access_key = YOUR_MINIO_SECRET_KEY
|
||||
|
||||
```
|
||||
#!/usr/bin/env python
|
||||
|
||||
import boto3
|
||||
s3 = boto3.resource('s3', use_ssl=False, endpoint_url="http://localhost:9000")
|
||||
for bucket in s3.buckets.all():
|
||||
print(bucket.name)
|
||||
...
|
||||
bucket1
|
||||
bucket2
|
||||
bucket3
|
||||
```
|
||||
|
||||
Grab it here [example-list-buckets.py](https://github.com/Minio-io/mc/blob/master/docs/sdks/python/example-list-buckets.py)
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'aws-sdk'
|
||||
|
||||
s3 = Aws::S3::Client.new(endpoint: "http://localhost:9000/",
|
||||
require_https_for_sse_cpk: false,
|
||||
region: "minio")
|
||||
resp = s3.list_buckets
|
||||
resp.buckets.each do |bucket|
|
||||
puts "#{bucket.name} => #{bucket.creation_date}"
|
||||
end
|
||||
@@ -0,0 +1,37 @@
|
||||
# Using AWS SDK for Ruby - Version 2
|
||||
|
||||
## Install
|
||||
|
||||
### In Ruby 1.9
|
||||
|
||||
```
|
||||
gem install aws-sdk
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
Next, set up credentials (in e.g. ``~/.aws/credentials``)::
|
||||
|
||||
[default]
|
||||
aws_access_key_id = YOUR_MINIO_ACCESS_ID
|
||||
aws_secret_access_key = YOUR_MINIO_SECRET_KEY
|
||||
|
||||
```
|
||||
#!/usr/bin/env ruby
|
||||
require 'aws-sdk'
|
||||
|
||||
s3 = Aws::S3::Client.new(endpoint: "http://127.0.0.1:9000/",
|
||||
require_https_for_sse_cpk: false,
|
||||
region: "minio")
|
||||
resp = s3.list_buckets
|
||||
resp.buckets.each do |bucket|
|
||||
puts "#{bucket.name} => #{bucket.creation_date}"
|
||||
end
|
||||
```
|
||||
|
||||
#### NOTE:
|
||||
|
||||
ruby ``aws-sdk`` requires region name should be set, please use any name which
|
||||
makes sense. Specifically for this example we choose ``minio``
|
||||
|
||||
Grab it here [example-list-buckets.rb](https://github.com/Minio-io/mc/blob/master/docs/sdks/ruby/example-list-buckets.rb)
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2014, 2015 Minio, Inc.
|
||||
* Minio Client (C) 2014, 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2014, 2015 Minio, Inc.
|
||||
* Minio Client (C) 2014, 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -87,7 +87,7 @@ var BuildDate string
|
||||
|
||||
func main() {
|
||||
app := cli.NewApp()
|
||||
app.Usage = "Mini Copy for object storage and filesystems"
|
||||
app.Usage = "Minio Client for object storage and filesystems"
|
||||
app.Version = Version
|
||||
app.Commands = commands
|
||||
app.Compiled, _ = time.Parse(time.RFC3339Nano, BuildDate)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this fs except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this fs except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this fs except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this fs except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this fs except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this fs except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this fs except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this fs except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Quick - Quick key value store for config files and persistent state files
|
||||
*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Quick - Quick key value store for config files and persistent state files
|
||||
*
|
||||
* Mini Copy (C) 2015 Minio, Inc.
|
||||
* Minio Client (C) 2015 Minio, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
Reference in New Issue
Block a user