Merge pull request #318 from harshavardhana/pr_out_remove_docs_directory_approaching_self_documentation
This commit is contained in:
@@ -379,6 +379,9 @@ func saveConfigCmd(ctx *cli.Context) {
|
||||
|
||||
// doConfigCmd is the handler for "mc config" sub-command.
|
||||
func doConfigCmd(ctx *cli.Context) {
|
||||
if len(ctx.Args()) < 1 {
|
||||
cli.ShowCommandHelpAndExit(ctx, "config", 1) // last argument is exit code
|
||||
}
|
||||
switch true {
|
||||
case ctx.Bool("completion") == true:
|
||||
getBashCompletionCmd()
|
||||
|
||||
+5
-6
@@ -93,7 +93,7 @@ EXAMPLES:
|
||||
mbCmd = cli.Command{
|
||||
Name: "mb",
|
||||
Usage: "makes a bucket",
|
||||
Description: "Creates an S3 bucket",
|
||||
Description: `Creates a bucket on Amazon S3, Minio Object Storage and Filesystem`,
|
||||
Action: doMakeBucketCmd,
|
||||
CustomHelpTemplate: `NAME:
|
||||
mc {{.Name}} - {{.Usage}}
|
||||
@@ -121,11 +121,10 @@ EXAMPLES:
|
||||
configCmd = cli.Command{
|
||||
Name: "config",
|
||||
Usage: "Generate configuration \"" + mustGetMcConfigPath() + "\" file.",
|
||||
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.`,
|
||||
Description: `Configure minio client configuration.
|
||||
|
||||
NOTE: that the configure command only writes values to the config file.
|
||||
It does not use any configuration values from the environment variables.`,
|
||||
Action: doConfigCmd,
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#### 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.
|
||||
|
||||
```
|
||||
@@ -1,26 +0,0 @@
|
||||
#### 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/
|
||||
|
||||
```
|
||||
@@ -1,24 +0,0 @@
|
||||
#### 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
|
||||
|
||||
```
|
||||
@@ -1,20 +0,0 @@
|
||||
#### 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
|
||||
|
||||
```
|
||||
@@ -1 +0,0 @@
|
||||
../CONTRIBUTING.md
|
||||
@@ -1,36 +0,0 @@
|
||||
### 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
|
||||
```
|
||||
@@ -1,79 +0,0 @@
|
||||
# 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
|
||||
```
|
||||
$ mc help
|
||||
|
||||
NAME:
|
||||
mc - Minio Client for S3 Compatible Object Storage
|
||||
|
||||
USAGE:
|
||||
mc [global options] command [command options] [arguments...]
|
||||
|
||||
VERSION:
|
||||
<---- GIT COMMIT ID ---->
|
||||
|
||||
BUILD:
|
||||
<---- BUILD TIME ---->
|
||||
|
||||
COMMANDS:
|
||||
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
|
||||
--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 config --completion
|
||||
|
||||
Configuration written to /home/user/.mc/mc.bash_completion
|
||||
|
||||
$ source ${HOME}/.mc/mc.bash_completion
|
||||
$ echo 'source ${HOME}/.mc/mc.bash_completion' >> ${HOME}/.bashrc
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
$ mc <TAB><TAB>
|
||||
config cp h help ls mb
|
||||
```
|
||||
@@ -1,62 +0,0 @@
|
||||
'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();
|
||||
|
||||
var statement = {
|
||||
Sid: "ExampleStatemenent1",
|
||||
Effect: "Allow",
|
||||
Principal: {
|
||||
AWS: "minio::1111111:murphy"
|
||||
},
|
||||
Action: [
|
||||
"minio:ListBucket",
|
||||
"minio:GetObject",
|
||||
"minio:PutObject",
|
||||
],
|
||||
Resource: [
|
||||
"minio:::examplebucket"
|
||||
]
|
||||
}
|
||||
|
||||
var policy = {
|
||||
Version: "2012-10-20",
|
||||
Statement: [statement],
|
||||
}
|
||||
|
||||
var params = {
|
||||
Bucket: 'docs',
|
||||
Policy: JSON.stringify(policy),
|
||||
}
|
||||
|
||||
s3.putBucketPolicy(params, function(err, data) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
|
||||
var params = {
|
||||
Bucket: 'docs'
|
||||
};
|
||||
|
||||
s3.getBucketPolicy(params, function(err, data) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
@@ -1,33 +0,0 @@
|
||||
'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);
|
||||
});
|
||||
@@ -1,118 +0,0 @@
|
||||
# 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)
|
||||
|
||||
### Example ``GetBucketPolicy`` and ``PutBucketPolicy``
|
||||
|
||||
```
|
||||
'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();
|
||||
|
||||
var statement = {
|
||||
Sid: "ExampleStatemenent1",
|
||||
Effect: "Allow",
|
||||
Principal: {
|
||||
AWS: "minio::1111111:murphy"
|
||||
},
|
||||
Action: [
|
||||
"minio:ListBucket",
|
||||
"minio:GetObject",
|
||||
"minio:PutObject",
|
||||
],
|
||||
Resource: [
|
||||
"minio:::examplebucket"
|
||||
]
|
||||
}
|
||||
|
||||
var policy = {
|
||||
Version: "2012-10-20",
|
||||
Statement: [statement],
|
||||
}
|
||||
|
||||
var params = {
|
||||
Bucket: 'docs',
|
||||
Policy: JSON.stringify(policy),
|
||||
}
|
||||
|
||||
s3.putBucketPolicy(params, function(err, data) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
|
||||
var params = {
|
||||
Bucket: 'docs'
|
||||
};
|
||||
|
||||
s3.getBucketPolicy(params, function(err, data) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Grab it here [example-bucket-policy.js](https://github.com/Minio-io/mc/blob/master/docs/sdks/js/example-bucket-policy.js)
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/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)
|
||||
@@ -1,34 +0,0 @@
|
||||
# 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)
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/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
|
||||
@@ -1,37 +0,0 @@
|
||||
# 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)
|
||||
Reference in New Issue
Block a user