mirror of https://github.com/minio/minio.git
f5b4b0765a
This updates dependency for - AWS S3 backend. - pkg/madmin ``` - Relax isValidBucketName to allow reading existing buckets. (#708) (3 minutes ago) <Harshavardhana> - For GCS the size limit of S3 is not useful. (#711) (3 days ago) <Harshavardhana> - s3utils: Support AWS S3 US GovCloud endpoint. (#701) (3 days ago) <Harshavardhana> - api: Always strip 80/443 port from host (#709) (3 days ago) <Anis Elleuch> - Redact signature strings properly. (#706) (4 days ago) <Harshavardhana> - api: Single putObject can use temporary file always. (#703) (6 days ago) <Harshavardhana> - Spelling fix (#704) (7 days ago) <Jacob Taylor> - api/encrypt: Get() on encrypted object should be a reader. (#699) (2 weeks ago) <Harshavardhana> - get: Fix reading an object if its size is unknown (#694) (3 weeks ago) <Anis Elleuch> - fixes #696 by updating the examples for put-encrypted-object and get-encrypted-object (#697) (3 weeks ago) <Tejay Cardon> - fix InvalidAccessKeyId error according to amazon documentation (#692) (4 weeks ago) <samkevich> - Add AWS S3 SSE-C example. (#689) (4 weeks ago) <Harshavardhana> - According to RFC7232 Etag should be in quotes for If-Match. (#688) (5 weeks ago) <Harshavardhana> - api: getReaderSize() should honor seeked file descriptors. (#681) (5 weeks ago) <Harshavardhana> - tests: Use bytes.Repeat() when generating big data (#683) (5 weeks ago) <Anis Elleuch> - api: Failed call retry with region only when http.StatusBadRequest. (#678) (5 weeks ago) <Harshavardhana> - api: Add NewWithCredentials() (#646) (5 weeks ago) <Harshavardhana> ``` |
||
---|---|---|
.. | ||
examples | ||
API.md | ||
README.md | ||
api-error-response.go | ||
api.go | ||
api_test.go | ||
config-commands.go | ||
constants.go | ||
generic-commands.go | ||
heal-commands.go | ||
info-commands.go | ||
lock-commands.go | ||
lock-commands_test.go | ||
service-commands.go | ||
utils.go |
README.md
Minio Admin Library.
The Minio Admin Golang Client SDK provides APIs to manage Minio services.
This quickstart guide will show you how to install the Minio Admin client SDK, connect to Minio admin service, and provide a walkthrough of a simple file uploader.
This document assumes that you have a working Golang setup.
Download from Github
go get -u github.com/minio/minio/pkg/madmin
Initialize Minio Admin Client
You need four items to connect to Minio admin services.
Parameter | Description |
---|---|
endpoint | URL to object storage service. |
accessKeyID | Access key is the user ID that uniquely identifies your account. |
secretAccessKey | Secret key is the password to your account. |
secure | Set this value to 'true' to enable secure (HTTPS) access. |
package main
import (
"github.com/minio/minio/pkg/madmin"
"log"
)
func main() {
endpoint := "your-minio.example.com:9000"
accessKeyID := "YOUR-ACCESSKEYID"
secretAccessKey := "YOUR-SECRETKEY"
useSSL := true
// Initialize minio admin client object.
madmClnt, err := madmin.New(endpoint, accessKeyID, secretAccessKey, useSSL)
if err != nil {
log.Fatalln(err)
}
log.Println("%v", madmClnt) // Minio admin client is now setup
Quick Start Example - Service Status.
This example program connects to minio server, gets the current disk status.
We will use the Minio server running at https://your-minio.example.com:9000 in this example. Feel free to use this service for testing and development. Access credentials shown in this example are open to the public.
ServiceStatus.go
package main
import (
"log"
"github.com/minio/minio/pkg/madmin"
)
func main() {
endpoint := "your-minio.example.com:9000"
accessKeyID := "YOUR-ACCESSKEYID"
secretAccessKey := "YOUR-SECRETKEY"
useSSL := true
// Initialize minio admin client.
mdmClnt, err := madmin.New(endpoint, accessKeyID, secretAccessKey, useSSL)
if err != nil {
log.Fatalln(err)
}
st, err := madmClnt.ServiceStatus()
if err != nil {
log.Fatalln(err)
}
log.Printf("%#v\n", st)
}
Run ServiceStatus
go run service-status.go
2016/12/20 16:46:01 madmin.ServiceStatusMetadata{Total:177038229504, Free:120365559808, Backend:struct { Type madmin.BackendType; OnlineDisks int; OfflineDisks int; ReadQuorum int; WriteQuorum int }{Type:1, OnlineDisks:0, OfflineDisks:0, ReadQuorum:0, WriteQuorum:0}}