Update documentation
This commit is contained in:
@@ -60,7 +60,7 @@ docs-deploy:
|
||||
install: test-all
|
||||
@echo "Installing mc:"
|
||||
@godep go install -a github.com/minio-io/mc
|
||||
@mkdir -p $(HOME)/.minio/mc
|
||||
@mkdir -p $(HOME)/.mc
|
||||
|
||||
clean:
|
||||
@rm -fv cover.out
|
||||
|
||||
@@ -12,6 +12,8 @@ mc - Minio Client for S3 Compatible Object Storage released under [Apache licens
|
||||
|
||||
### Commands
|
||||
```
|
||||
$ mc help
|
||||
|
||||
NAME:
|
||||
mc - Minio Client for S3 Compatible Object Storage
|
||||
|
||||
@@ -19,46 +21,59 @@ USAGE:
|
||||
mc [global options] command [command options] [arguments...]
|
||||
|
||||
VERSION:
|
||||
0.1.0
|
||||
<---- GIT COMMIT ID ---->
|
||||
|
||||
AUTHOR:
|
||||
Minio.io
|
||||
BUILD:
|
||||
<---- BUILD TIME ---->
|
||||
|
||||
COMMANDS:
|
||||
cp copy objects
|
||||
ls get list of objects
|
||||
mb makes a bucket
|
||||
config Generate configuration "/home/harsha/.minio/mc/config.json" file.
|
||||
help, h Shows a list of commands or help for one command
|
||||
cp copy objects and files
|
||||
ls list files and objects
|
||||
mb makes a bucket
|
||||
config Generate configuration "/home/alexa/.mc/config.json" file.
|
||||
|
||||
GLOBAL OPTIONS:
|
||||
--debug enable HTTP tracing
|
||||
--quiet, -q disable chatty output, such as the progress bar
|
||||
--get-bash-completion Generate bash completion "/home/harsha/.minio/mc/mc.bash_completion" file.
|
||||
--help, -h show help
|
||||
--generate-bash-completion
|
||||
--version, -v print the version
|
||||
--debug enable HTTP tracing
|
||||
--quiet, -q disable chatty output, such as the progress bar
|
||||
--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 |
|
||||
| arm64 | Not yet|
|
||||
| i386 | Not yet |
|
||||
|
||||
### Enable bash completion
|
||||
|
||||
To generate bash completion for ``mc`` all you have to do is
|
||||
|
||||
```
|
||||
$ mc --get-bash-completion
|
||||
$ mc config --completion
|
||||
|
||||
Configuration written to /home/user/.minio/mc/mc.bash_completion
|
||||
Configuration written to /home/user/.mc/mc.bash_completion
|
||||
|
||||
$ source ${HOME}/.minio/mc/mc.bash_completion
|
||||
$ echo 'source ${HOME}/.minio/mc/mc.bash_completion' >> ${HOME}/.bashrc
|
||||
$ source ${HOME}/.mc/mc.bash_completion
|
||||
$ echo 'source ${HOME}/.mc/mc.bash_completion' >> ${HOME}/.bashrc
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
$ mc <TAB><TAB>
|
||||
config cp h help ls mb sync
|
||||
config cp h help ls mb
|
||||
```
|
||||
|
||||
+1
-17
@@ -177,7 +177,7 @@ func getNewClient(debug bool, urlStr string) (clnt client.Client, err error) {
|
||||
}
|
||||
|
||||
switch uType {
|
||||
case urlS3: // Minio and S3 compatible object storage
|
||||
case urlObjectStorage: // Minio and S3 compatible object storage
|
||||
traceTransport := getTraceTransport()
|
||||
if debug {
|
||||
clnt = s3.GetNewClient(&auth, urlStr, traceTransport)
|
||||
@@ -185,22 +185,6 @@ func getNewClient(debug bool, urlStr string) (clnt client.Client, err error) {
|
||||
clnt = s3.GetNewClient(&auth, urlStr, http.DefaultTransport)
|
||||
}
|
||||
return clnt, nil
|
||||
|
||||
// TODO: donut.GetNewClient should only take donutName as input. Rest it should read from its own config file.
|
||||
/*
|
||||
case urlDonut: // Donut object storage
|
||||
|
||||
host, err := url2Host(urlStr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
clnt, err := donut.GetNewClient(host, nodeDiskMap)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return clnt, nil */
|
||||
case urlFile: // POSIX compatible file systems
|
||||
fallthrough
|
||||
case urlUnknown: // Unknown type
|
||||
|
||||
+2
-2
@@ -209,8 +209,8 @@ func getBashCompletion() {
|
||||
fatal(err)
|
||||
}
|
||||
msg := "\nConfiguration written to " + f
|
||||
msg = msg + "\n\n$ source ${HOME}/.minio/mc/mc.bash_completion\n"
|
||||
msg = msg + "$ echo 'source ${HOME}/.minio/mc/mc.bash_completion' >> ${HOME}/.bashrc\n"
|
||||
msg = msg + "\n\n$ source ${HOME}/.mc/mc.bash_completion\n"
|
||||
msg = msg + "$ echo 'source ${HOME}/.mc/mc.bash_completion' >> ${HOME}/.bashrc\n"
|
||||
info(msg)
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -27,7 +27,7 @@ var (
|
||||
cpCmd = cli.Command{
|
||||
Name: "cp",
|
||||
Usage: "copy objects and files",
|
||||
Description: "Copy files and objects recursively between Amazon S3, Donut and Filesystem",
|
||||
Description: "Copy files and objects recursively between Amazon S3, Minio Object Storage and Filesystem",
|
||||
Action: doCopyCmd,
|
||||
Flags: []cli.Flag{
|
||||
cli.BoolFlag{
|
||||
@@ -63,7 +63,7 @@ EXAMPLES:
|
||||
lsCmd = cli.Command{
|
||||
Name: "ls",
|
||||
Usage: "list files and objects",
|
||||
Description: `List files and objects recursively between Amazon S3, Donut and Filesystem`,
|
||||
Description: `List files and objects recursively between Amazon S3, Minio Object Storage and Filesystem`,
|
||||
Action: doListCmd,
|
||||
CustomHelpTemplate: `NAME:
|
||||
mc {{.Name}} - {{.Usage}}
|
||||
@@ -154,7 +154,7 @@ EXAMPLES:
|
||||
)
|
||||
|
||||
type object struct {
|
||||
scheme string // protocol type: possible values are http, https, donut, nil
|
||||
scheme string // protocol type: possible values are http, https, nil
|
||||
host string
|
||||
// Bucket name can also be a DNS name. "." is allowed, with certain restrictions.
|
||||
// Read more at http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#### generate config
|
||||
|
||||
```
|
||||
NAME:
|
||||
config - Generate configuration "/home/alexa/.mc/config.json" file.
|
||||
|
||||
USAGE:
|
||||
command config [command options] [arguments...]
|
||||
|
||||
DESCRIPTION:
|
||||
Configure minio client configuration data. If your config
|
||||
file does not exist (the default location is ~/.auth), it will be
|
||||
automatically created for you. Note that the configure command only writes
|
||||
values to the config file. It does not use any configuration values from
|
||||
the environment variables.
|
||||
|
||||
OPTIONS:
|
||||
--accesskeyid, -a AWS access key ID
|
||||
--secretkey, -s AWS secret access key
|
||||
--alias Add aliases into config
|
||||
--completion Generate bash completion "/home/alexa/.mc/mc.bash_completion" file.
|
||||
|
||||
```
|
||||
@@ -0,0 +1,26 @@
|
||||
#### copy objects
|
||||
|
||||
```
|
||||
NAME:
|
||||
mc cp - copy objects and files
|
||||
|
||||
USAGE:
|
||||
mc cp [ARGS...] SOURCE TARGET [TARGET...]
|
||||
|
||||
DESCRIPTION:
|
||||
Copy files and objects recursively between Amazon S3, Minio Object Storage and Filesystem
|
||||
|
||||
OPTIONS:
|
||||
--recursive, -r recursively crawls a given directory or bucket
|
||||
|
||||
EXAMPLES:
|
||||
1. Copy an object from Amazon S3 object storage to local fileystem.
|
||||
$ mc cp https://s3.amazonaws.com/jukebox/klingon_opera_aktuh_maylotah.ogg wakeup.ogg
|
||||
|
||||
2. Copy a bucket recursive from Minio object storage to Amazon S3 object storage
|
||||
$ mc cp --recursive http://localhost:9000/photos/burningman2011 https://s3.amazonaws.com/burningman/
|
||||
|
||||
3. Copy a local folder to Minio object storage and Amazon S3 object storage
|
||||
$ mc cp --recursive backup/ http://localhost:9000/archive/ https://s3.amazonaws.com/archive/
|
||||
|
||||
```
|
||||
@@ -0,0 +1,24 @@
|
||||
#### list objects
|
||||
|
||||
```
|
||||
NAME:
|
||||
mc ls - list files and objects
|
||||
|
||||
USAGE:
|
||||
mc ls TARGET
|
||||
|
||||
DESCRIPTION:
|
||||
List files and objects recursively between Amazon S3, Minio Object Storage and Filesystem
|
||||
|
||||
EXAMPLES:
|
||||
1. List objects on Minio object storage
|
||||
$ mc ls http://localhost:9000/backup/
|
||||
2015-03-28 12:47:50 PDT 51.00 MB 2006-Jan-1/backup.tar.gz
|
||||
2015-03-31 14:46:33 PDT 55.00 MB 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 rom
|
||||
2015-01-15 00:05:40 PST zek
|
||||
|
||||
```
|
||||
@@ -0,0 +1,20 @@
|
||||
#### make bucket
|
||||
|
||||
```
|
||||
NAME:
|
||||
mc mb - makes a bucket
|
||||
|
||||
USAGE:
|
||||
mc mb TARGET
|
||||
|
||||
DESCRIPTION:
|
||||
Creates an S3 bucket
|
||||
|
||||
EXAMPLES:
|
||||
1. Create a bucket on Amazon S3 object storage
|
||||
$ mc mb https://s3.amazonaws.com/public-photo-store
|
||||
|
||||
2. Create a bucket on Minio object storage
|
||||
$ mc mb http://localhost:9000/mongodb-backup
|
||||
|
||||
```
|
||||
@@ -0,0 +1,36 @@
|
||||
### Debugging ``mc`` commands
|
||||
|
||||
#### mb [DEBUG]
|
||||
```
|
||||
$ mc --debug mb localhost:localbucket
|
||||
PUT /localbucket HTTP/1.1
|
||||
Host: localhost:9000
|
||||
User-Agent: Minio s3Client
|
||||
Content-Length: 0
|
||||
Authorization: AWS **PASSWORD**STRIPPED**
|
||||
Date: Wed, 08 Apr 2015 23:44:29 GMT
|
||||
Accept-Encoding: gzip
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
```
|
||||
|
||||
#### ls [DEBUG]
|
||||
```
|
||||
$ mc --debug ls localhost:
|
||||
GET / HTTP/1.1
|
||||
Host: localhost:9000
|
||||
User-Agent: Minio s3Client
|
||||
Authorization: AWS **PASSWORD**STRIPPED**
|
||||
Date: Wed, 08 Apr 2015 23:42:36 GMT
|
||||
Accept-Encoding: gzip
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-Length: 221
|
||||
Accept-Ranges: bytes
|
||||
Content-Type: application/xml
|
||||
Date: Wed, 08 Apr 2015 23:42:36 GMT
|
||||
Server: Minio
|
||||
|
||||
2015-04-08 09:42:36 PDT newbucket
|
||||
```
|
||||
+34
-19
@@ -12,6 +12,8 @@ mc - Minio Client for S3 Compatible Object Storage released under [Apache licens
|
||||
|
||||
### Commands
|
||||
```
|
||||
$ mc help
|
||||
|
||||
NAME:
|
||||
mc - Minio Client for S3 Compatible Object Storage
|
||||
|
||||
@@ -19,46 +21,59 @@ USAGE:
|
||||
mc [global options] command [command options] [arguments...]
|
||||
|
||||
VERSION:
|
||||
0.1.0
|
||||
<---- GIT COMMIT ID ---->
|
||||
|
||||
AUTHOR:
|
||||
Minio.io
|
||||
BUILD:
|
||||
<---- BUILD TIME ---->
|
||||
|
||||
COMMANDS:
|
||||
cp copy objects
|
||||
ls get list of objects
|
||||
mb makes a bucket
|
||||
config Generate configuration "/home/harsha/.minio/mc/config.json" file.
|
||||
help, h Shows a list of commands or help for one command
|
||||
cp copy objects and files
|
||||
ls list files and objects
|
||||
mb makes a bucket
|
||||
config Generate configuration "/home/alexa/.mc/config.json" file.
|
||||
|
||||
GLOBAL OPTIONS:
|
||||
--debug enable HTTP tracing
|
||||
--quiet, -q disable chatty output, such as the progress bar
|
||||
--get-bash-completion Generate bash completion "/home/harsha/.minio/mc/mc.bash_completion" file.
|
||||
--help, -h show help
|
||||
--generate-bash-completion
|
||||
--version, -v print the version
|
||||
--debug enable HTTP tracing
|
||||
--quiet, -q disable chatty output, such as the progress bar
|
||||
--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 |
|
||||
| arm64 | Not yet|
|
||||
| i386 | Not yet |
|
||||
|
||||
### Enable bash completion
|
||||
|
||||
To generate bash completion for ``mc`` all you have to do is
|
||||
|
||||
```
|
||||
$ mc --get-bash-completion
|
||||
$ mc config --completion
|
||||
|
||||
Configuration written to /home/user/.minio/mc/mc.bash_completion
|
||||
Configuration written to /home/user/.mc/mc.bash_completion
|
||||
|
||||
$ source ${HOME}/.minio/mc/mc.bash_completion
|
||||
$ echo 'source ${HOME}/.minio/mc/mc.bash_completion' >> ${HOME}/.bashrc
|
||||
$ source ${HOME}/.mc/mc.bash_completion
|
||||
$ echo 'source ${HOME}/.mc/mc.bash_completion' >> ${HOME}/.bashrc
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
$ mc <TAB><TAB>
|
||||
config cp h help ls mb sync
|
||||
config cp h help ls mb
|
||||
```
|
||||
|
||||
+9
-4
@@ -1,8 +1,13 @@
|
||||
site_name: Minio Client Documentation
|
||||
pages:
|
||||
- ['index.md', Index]
|
||||
- ['sdks/js/javascript.md', 'SDKs', 'Javascript']
|
||||
- ['sdks/python/python.md', 'SDKs', 'Python']
|
||||
- ['sdks/ruby/ruby.md', 'SDKs', 'Ruby']
|
||||
- ['contributing.md', 'Contributing', 'Overview']
|
||||
- ['commands/config.md', 'Commands', 'config']
|
||||
- ['commands/ls.md', 'Commands', 'ls']
|
||||
- ['commands/cp.md', 'Commands', 'cp']
|
||||
- ['commands/mb.md', 'Commands', 'mb']
|
||||
- ['sdks/js/javascript.md', 'SDKs']
|
||||
- ['sdks/python/python.md', 'SDKs']
|
||||
- ['sdks/ruby/ruby.md', 'SDKs']
|
||||
- ['contributing.md', 'Contributing']
|
||||
- ['debugging.md', 'Debugging']
|
||||
theme: readthedocs
|
||||
|
||||
@@ -50,7 +50,6 @@ Example AWS S3 Request / Response
|
||||
X-Amz-Request-Id: 5E9A737908F886D0
|
||||
|
||||
2015-03-11 01:28:03 -0700 PDT 1.10 KB color.go
|
||||
2015-03-07 15:53:44 -0800 PST 2.58 KB donut.go
|
||||
2015-03-08 03:31:50 -0700 PDT 11.09 KB apache/license.txt
|
||||
*/
|
||||
|
||||
|
||||
+4
-7
@@ -29,10 +29,9 @@ import (
|
||||
type urlType int
|
||||
|
||||
const (
|
||||
urlUnknown urlType = iota // Unknown type
|
||||
urlS3 // Minio and S3 compatible object storage
|
||||
urlDonut // Donut object storage
|
||||
urlFile // POSIX compatible file systems
|
||||
urlUnknown urlType = iota // Unknown type
|
||||
urlObjectStorage // Minio and S3 compatible object storage
|
||||
urlFile // POSIX compatible file systems
|
||||
)
|
||||
|
||||
// urlType detects the type of URL
|
||||
@@ -45,9 +44,7 @@ func getURLType(urlStr string) (uType urlType, err error) {
|
||||
case "http":
|
||||
fallthrough
|
||||
case "https":
|
||||
return urlS3, nil
|
||||
case "donut":
|
||||
return urlDonut, nil
|
||||
return urlObjectStorage, nil
|
||||
case "file":
|
||||
fallthrough
|
||||
case "":
|
||||
|
||||
Reference in New Issue
Block a user