diff --git a/NOTICE b/NOTICE index e91b717d..3ffed5c2 100644 --- a/NOTICE +++ b/NOTICE @@ -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/). diff --git a/README.md b/README.md index 2f1f9fc3..fe2fcf7e 100644 --- a/README.md +++ b/README.md @@ -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). [![GoDoc](https://godoc.org/github.com/minio-io/mc?status.svg)](https://godoc.org/github.com/minio-io/mc) - [![Build Status](https://travis-ci.org/minio-io/mc.svg)](https://travis-ci.org/minio-io/mc) +[![Build Status](https://travis-ci.org/minio-io/mc.svg)](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) - diff --git a/acl.go b/acl.go index 9b9a30f6..396ab85f 100644 --- a/acl.go +++ b/acl.go @@ -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. diff --git a/aliases.go b/aliases.go index 80fc0b41..32341e7a 100644 --- a/aliases.go +++ b/aliases.go @@ -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. diff --git a/buildscripts/checkdeps.sh b/buildscripts/checkdeps.sh index 414d6f20..ce7f8a18 100755 --- a/buildscripts/checkdeps.sh +++ b/buildscripts/checkdeps.sh @@ -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. diff --git a/clientmethods.go b/clientmethods.go index a8f46938..877b0513 100644 --- a/clientmethods.go +++ b/clientmethods.go @@ -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. diff --git a/cmd-access.go b/cmd-access.go index 133f6cfd..2604f4fc 100644 --- a/cmd-access.go +++ b/cmd-access.go @@ -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. diff --git a/cmd-cat.go b/cmd-cat.go index aad8b2aa..a4d29741 100644 --- a/cmd-cat.go +++ b/cmd-cat.go @@ -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. diff --git a/cmd-common.go b/cmd-common.go index a35bd9b0..b6292971 100644 --- a/cmd-common.go +++ b/cmd-common.go @@ -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. diff --git a/cmd-config.go b/cmd-config.go index 3116af1f..8c6a9eed 100644 --- a/cmd-config.go +++ b/cmd-config.go @@ -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. diff --git a/cmd-cp.go b/cmd-cp.go index ca2b4c81..5bb00129 100644 --- a/cmd-cp.go +++ b/cmd-cp.go @@ -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. diff --git a/cmd-ls.go b/cmd-ls.go index c0904282..b419aec5 100644 --- a/cmd-ls.go +++ b/cmd-ls.go @@ -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. diff --git a/cmd-mb.go b/cmd-mb.go index 3f7d00e0..4a2a4a2c 100644 --- a/cmd-mb.go +++ b/cmd-mb.go @@ -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. diff --git a/cmd-options.go b/cmd-options.go index ff8e0150..d432dec6 100644 --- a/cmd-options.go +++ b/cmd-options.go @@ -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, } ) diff --git a/cmd-update.go b/cmd-update.go index 03a10cf5..b64cc88d 100644 --- a/cmd-update.go +++ b/cmd-update.go @@ -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") } } diff --git a/cmd_test.go b/cmd_test.go index e09ba31b..72cf4c87 100644 --- a/cmd_test.go +++ b/cmd_test.go @@ -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. diff --git a/cp-methods.go b/cp-methods.go index 4b356513..e518620b 100644 --- a/cp-methods.go +++ b/cp-methods.go @@ -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. diff --git a/cp-url.go b/cp-url.go index bf3667be..b8f5f897 100644 --- a/cp-url.go +++ b/cp-url.go @@ -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. diff --git a/cp.go b/cp.go index 527e9394..0a3069eb 100644 --- a/cp.go +++ b/cp.go @@ -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. diff --git a/doc.go b/doc.go index 8258429b..bcecedc5 100644 --- a/doc.go +++ b/doc.go @@ -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. diff --git a/docs/commands/access.md b/docs/commands/access.md new file mode 100644 index 00000000..7edaec00 --- /dev/null +++ b/docs/commands/access.md @@ -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 + +``` \ No newline at end of file diff --git a/docs/commands/cat.md b/docs/commands/cat.md new file mode 100644 index 00000000..fbf41da2 --- /dev/null +++ b/docs/commands/cat.md @@ -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 +``` \ No newline at end of file diff --git a/docs/commands/config.md b/docs/commands/config.md new file mode 100644 index 00000000..7770fc4c --- /dev/null +++ b/docs/commands/config.md @@ -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/" + +``` diff --git a/docs/commands/cp.md b/docs/commands/cp.md new file mode 100644 index 00000000..314acad8 --- /dev/null +++ b/docs/commands/cp.md @@ -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 + +``` \ No newline at end of file diff --git a/docs/commands/ls.md b/docs/commands/ls.md new file mode 100644 index 00000000..bbbe23a8 --- /dev/null +++ b/docs/commands/ls.md @@ -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/ + +``` diff --git a/docs/commands/mb.md b/docs/commands/mb.md new file mode 100644 index 00000000..7b1513bf --- /dev/null +++ b/docs/commands/mb.md @@ -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 + +``` \ No newline at end of file diff --git a/docs/contributing.md b/docs/contributing.md new file mode 120000 index 00000000..44fcc634 --- /dev/null +++ b/docs/contributing.md @@ -0,0 +1 @@ +../CONTRIBUTING.md \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..d9e82224 --- /dev/null +++ b/docs/index.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 | diff --git a/docs/sdks/js/example-list.js b/docs/sdks/js/example-list.js new file mode 100644 index 00000000..afa01758 --- /dev/null +++ b/docs/sdks/js/example-list.js @@ -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); +}); diff --git a/docs/sdks/js/javascript.md b/docs/sdks/js/javascript.md new file mode 100644 index 00000000..56ab6990 --- /dev/null +++ b/docs/sdks/js/javascript.md @@ -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) diff --git a/docs/sdks/python/example-list-buckets.py b/docs/sdks/python/example-list-buckets.py new file mode 100644 index 00000000..0d1cf793 --- /dev/null +++ b/docs/sdks/python/example-list-buckets.py @@ -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) diff --git a/docs/sdks/python/python.md b/docs/sdks/python/python.md new file mode 100644 index 00000000..daee0f63 --- /dev/null +++ b/docs/sdks/python/python.md @@ -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) \ No newline at end of file diff --git a/docs/sdks/ruby/example-list-buckets.rb b/docs/sdks/ruby/example-list-buckets.rb new file mode 100644 index 00000000..0497ec27 --- /dev/null +++ b/docs/sdks/ruby/example-list-buckets.rb @@ -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 diff --git a/docs/sdks/ruby/ruby.md b/docs/sdks/ruby/ruby.md new file mode 100644 index 00000000..a4faa779 --- /dev/null +++ b/docs/sdks/ruby/ruby.md @@ -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) \ No newline at end of file diff --git a/errors.go b/errors.go index 66da6f00..c011236d 100644 --- a/errors.go +++ b/errors.go @@ -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. diff --git a/globals.go b/globals.go index 71952442..f6d32b60 100644 --- a/globals.go +++ b/globals.go @@ -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. diff --git a/hostconfig.go b/hostconfig.go index faa8e4a4..7d0f24cd 100644 --- a/hostconfig.go +++ b/hostconfig.go @@ -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. diff --git a/ls.go b/ls.go index f7440693..d7e02767 100644 --- a/ls.go +++ b/ls.go @@ -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. diff --git a/main.go b/main.go index 84fbf83c..ad657eb3 100644 --- a/main.go +++ b/main.go @@ -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) diff --git a/mock_clientmethods_test.go b/mock_clientmethods_test.go index bd82f243..5e1ac420 100644 --- a/mock_clientmethods_test.go +++ b/mock_clientmethods_test.go @@ -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. diff --git a/notifier.go b/notifier.go index 9e61c7aa..18792359 100644 --- a/notifier.go +++ b/notifier.go @@ -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. diff --git a/pkg/client/auth.go b/pkg/client/auth.go index c5a9f05d..86d4e8e6 100644 --- a/pkg/client/auth.go +++ b/pkg/client/auth.go @@ -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. diff --git a/pkg/client/blockingwriter.go b/pkg/client/blockingwriter.go index bf085c72..63f83d33 100644 --- a/pkg/client/blockingwriter.go +++ b/pkg/client/blockingwriter.go @@ -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. diff --git a/pkg/client/client.go b/pkg/client/client.go index 1c4b5388..61065094 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -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. diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index e8f0cbcc..872f4e3a 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -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. diff --git a/pkg/client/errors.go b/pkg/client/errors.go index 3b898a11..5bac0559 100644 --- a/pkg/client/errors.go +++ b/pkg/client/errors.go @@ -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. diff --git a/pkg/client/fs/fs.go b/pkg/client/fs/fs.go index 5704db76..bd755568 100644 --- a/pkg/client/fs/fs.go +++ b/pkg/client/fs/fs.go @@ -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. diff --git a/pkg/client/fs/fs_errors.go b/pkg/client/fs/fs_errors.go index 9484aae5..181bb21a 100644 --- a/pkg/client/fs/fs_errors.go +++ b/pkg/client/fs/fs_errors.go @@ -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. diff --git a/pkg/client/fs/fs_multi.go b/pkg/client/fs/fs_multi.go index 70c059f8..9bd3657c 100644 --- a/pkg/client/fs/fs_multi.go +++ b/pkg/client/fs/fs_multi.go @@ -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. diff --git a/pkg/client/fs/fs_put.go b/pkg/client/fs/fs_put.go index 5da61ddb..b14884ba 100644 --- a/pkg/client/fs/fs_put.go +++ b/pkg/client/fs/fs_put.go @@ -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. diff --git a/pkg/client/fs/fs_test.go b/pkg/client/fs/fs_test.go index c9e765d8..2a87b44d 100644 --- a/pkg/client/fs/fs_test.go +++ b/pkg/client/fs/fs_test.go @@ -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. diff --git a/pkg/client/mocks/Client.go b/pkg/client/mocks/Client.go index 31680789..699a6958 100644 --- a/pkg/client/mocks/Client.go +++ b/pkg/client/mocks/Client.go @@ -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. diff --git a/pkg/client/mocks/HTTPTracer.go b/pkg/client/mocks/HTTPTracer.go index b20f2a16..5d03c90f 100644 --- a/pkg/client/mocks/HTTPTracer.go +++ b/pkg/client/mocks/HTTPTracer.go @@ -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. diff --git a/pkg/client/mocks/MultipartUpload.go b/pkg/client/mocks/MultipartUpload.go index 166b6d0c..50e1fb47 100644 --- a/pkg/client/mocks/MultipartUpload.go +++ b/pkg/client/mocks/MultipartUpload.go @@ -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. diff --git a/pkg/client/s3/auth.go b/pkg/client/s3/auth.go index 711c7078..408f5af3 100644 --- a/pkg/client/s3/auth.go +++ b/pkg/client/s3/auth.go @@ -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. diff --git a/pkg/client/s3/auth_test.go b/pkg/client/s3/auth_test.go index af0b549e..c1d48d8f 100644 --- a/pkg/client/s3/auth_test.go +++ b/pkg/client/s3/auth_test.go @@ -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. diff --git a/pkg/client/s3/bucket.go b/pkg/client/s3/bucket.go index a0abd3b6..029bc1b7 100644 --- a/pkg/client/s3/bucket.go +++ b/pkg/client/s3/bucket.go @@ -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. diff --git a/pkg/client/s3/bucket_list.go b/pkg/client/s3/bucket_list.go index 1afb2eab..54134a65 100644 --- a/pkg/client/s3/bucket_list.go +++ b/pkg/client/s3/bucket_list.go @@ -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. diff --git a/pkg/client/s3/client.go b/pkg/client/s3/client.go index cecca92d..58d8af72 100644 --- a/pkg/client/s3/client.go +++ b/pkg/client/s3/client.go @@ -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. diff --git a/pkg/client/s3/client_test.go b/pkg/client/s3/client_test.go index 5960acfa..e8ab3369 100644 --- a/pkg/client/s3/client_test.go +++ b/pkg/client/s3/client_test.go @@ -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. diff --git a/pkg/client/s3/errors.go b/pkg/client/s3/errors.go index e15a0795..84dcd8f9 100644 --- a/pkg/client/s3/errors.go +++ b/pkg/client/s3/errors.go @@ -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. diff --git a/pkg/client/s3/globals.go b/pkg/client/s3/globals.go index ff8ca241..3d2aa7a3 100644 --- a/pkg/client/s3/globals.go +++ b/pkg/client/s3/globals.go @@ -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. diff --git a/pkg/client/s3/httptrace.go b/pkg/client/s3/httptrace.go index b003643b..82740076 100644 --- a/pkg/client/s3/httptrace.go +++ b/pkg/client/s3/httptrace.go @@ -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. diff --git a/pkg/client/s3/object_get.go b/pkg/client/s3/object_get.go index bb12f77f..71e618ef 100644 --- a/pkg/client/s3/object_get.go +++ b/pkg/client/s3/object_get.go @@ -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. diff --git a/pkg/client/s3/object_multi.go b/pkg/client/s3/object_multi.go index 4af5dd49..b6d2622c 100644 --- a/pkg/client/s3/object_multi.go +++ b/pkg/client/s3/object_multi.go @@ -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. diff --git a/pkg/client/s3/object_put.go b/pkg/client/s3/object_put.go index 8549bc58..67499849 100644 --- a/pkg/client/s3/object_put.go +++ b/pkg/client/s3/object_put.go @@ -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. diff --git a/pkg/client/s3/s3verify.go b/pkg/client/s3/s3verify.go index b7448443..54bb1111 100644 --- a/pkg/client/s3/s3verify.go +++ b/pkg/client/s3/s3verify.go @@ -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. diff --git a/pkg/client/s3/trace.go b/pkg/client/s3/trace.go index 1d95522b..7e566dfc 100644 --- a/pkg/client/s3/trace.go +++ b/pkg/client/s3/trace.go @@ -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. diff --git a/pkg/client/url.go b/pkg/client/url.go index 399244a8..777e7cf0 100644 --- a/pkg/client/url.go +++ b/pkg/client/url.go @@ -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. diff --git a/pkg/console/console.go b/pkg/console/console.go index 390edc55..aeab9710 100644 --- a/pkg/console/console.go +++ b/pkg/console/console.go @@ -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. diff --git a/pkg/console/console_test.go b/pkg/console/console_test.go index 486849bd..7e7dd7f1 100644 --- a/pkg/console/console_test.go +++ b/pkg/console/console_test.go @@ -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. diff --git a/pkg/console/themes.go b/pkg/console/themes.go index 38e01123..788a8859 100644 --- a/pkg/console/themes.go +++ b/pkg/console/themes.go @@ -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. diff --git a/pkg/quick/quick.go b/pkg/quick/quick.go index e08c301e..c9d96291 100644 --- a/pkg/quick/quick.go +++ b/pkg/quick/quick.go @@ -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. diff --git a/pkg/quick/quick_test.go b/pkg/quick/quick_test.go index b486d557..731e5079 100644 --- a/pkg/quick/quick_test.go +++ b/pkg/quick/quick_test.go @@ -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. diff --git a/url.go b/url.go index 1c7d311c..3c0ba64f 100644 --- a/url.go +++ b/url.go @@ -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.