package
3.0.0+incompatible
Repository: https://github.com/openmpdk/dss-minio.git
Documentation: pkg.go.dev
# README
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 - Server Info
This example program connects to minio server, gets the current disk status and other useful server information.
ServiceStatus.go
package main
import (
"encoding/json"
"fmt"
"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)
}
si, err := mdmClnt.ServerInfo()
if err != nil {
log.Fatalln(err)
}
b, err := json.Marshal(si)
fmt.Printf("%s\n", string(b))
}
Replace the endpoint and access credentials above according to an actual setup.
Run ServiceStatus
The sample output below shows the result of executing the above program against a locally hosted server.
[{"error":"","addr":"localhost:9000","data":{"storage":{"Total":460373336064,"Free":77001187328,"Backend":{"Type":2,"OnlineDisks":4,"OfflineDisks":0,"StandardSCParity":2,"RRSCParity":2}},"network":{"transferred":30599,"received":36370},"http":{"totalHEADs":{"count":0,"avgDuration":"0s"},"successHEADs":{"count":0,"avgDuration":"0s"},"totalGETs":{"count":11,"avgDuration":"0s"},"successGETs":{"count":11,"avgDuration":"0s"},"totalPUTs":{"count":0,"avgDuration":"0s"},"successPUTs":{"count":0,"avgDuration":"0s"},"totalPOSTs":{"count":0,"avgDuration":"0s"},"successPOSTs":{"count":0,"avgDuration":"0s"},"totalDELETEs":{"count":0,"avgDuration":"0s"},"successDELETEs":{"count":0,"avgDuration":"0s"}},"server":{"uptime":596915001694,"version":"2018-01-18T20:33:21Z","commitID":"e2d5a87b2676e3e01f0f4fa7ebd01205364cfb16","region":"us-east-1","sqsARN":null}}},{"error":"","addr":"minio2:9000","data":{"storage":{"Total":460373336064,"Free":77001187328,"Backend":{"Type":2,"OnlineDisks":4,"OfflineDisks":0,"StandardSCParity":2,"RRSCParity":2}},"network":{"transferred":28538,"received":11845},"http":{"totalHEADs":{"count":0,"avgDuration":"0s"},"successHEADs":{"count":0,"avgDuration":"0s"},"totalGETs":{"count":0,"avgDuration":"0s"},"successGETs":{"count":0,"avgDuration":"0s"},"totalPUTs":{"count":0,"avgDuration":"0s"},"successPUTs":{"count":0,"avgDuration":"0s"},"totalPOSTs":{"count":0,"avgDuration":"0s"},"successPOSTs":{"count":0,"avgDuration":"0s"},"totalDELETEs":{"count":0,"avgDuration":"0s"},"successDELETEs":{"count":0,"avgDuration":"0s"}},"server":{"uptime":595852367296,"version":"2018-01-18T20:33:21Z","commitID":"e2d5a87b2676e3e01f0f4fa7ebd01205364cfb16","region":"us-east-1","sqsARN":null}}},{"error":"","addr":"minio3:9000","data":{"storage":{"Total":460373336064,"Free":77001187328,"Backend":{"Type":2,"OnlineDisks":4,"OfflineDisks":0,"StandardSCParity":2,"RRSCParity":2}},"network":{"transferred":27624,"received":11708},"http":{"totalHEADs":{"count":0,"avgDuration":"0s"},"successHEADs":{"count":0,"avgDuration":"0s"},"totalGETs":{"count":0,"avgDuration":"0s"},"successGETs":{"count":0,"avgDuration":"0s"},"totalPUTs":{"count":0,"avgDuration":"0s"},"successPUTs":{"count":0,"avgDuration":"0s"},"totalPOSTs":{"count":0,"avgDuration":"0s"},"successPOSTs":{"count":0,"avgDuration":"0s"},"totalDELETEs":{"count":0,"avgDuration":"0s"},"successDELETEs":{"count":0,"avgDuration":"0s"}},"server":{"uptime":595831126778,"version":"2018-01-18T20:33:21Z","commitID":"e2d5a87b2676e3e01f0f4fa7ebd01205364cfb16","region":"us-east-1","sqsARN":null}}},{"error":"","addr":"minio4:9000","data":{"storage":{"Total":460373336064,"Free":77001187328,"Backend":{"Type":2,"OnlineDisks":4,"OfflineDisks":0,"StandardSCParity":2,"RRSCParity":2}},"network":{"transferred":27740,"received":12116},"http":{"totalHEADs":{"count":0,"avgDuration":"0s"},"successHEADs":{"count":0,"avgDuration":"0s"},"totalGETs":{"count":0,"avgDuration":"0s"},"successGETs":{"count":0,"avgDuration":"0s"},"totalPUTs":{"count":0,"avgDuration":"0s"},"successPUTs":{"count":0,"avgDuration":"0s"},"totalPOSTs":{"count":0,"avgDuration":"0s"},"successPOSTs":{"count":0,"avgDuration":"0s"},"totalDELETEs":{"count":0,"avgDuration":"0s"},"successDELETEs":{"count":0,"avgDuration":"0s"}},"server":{"uptime":595349958375,"version":"2018-01-18T20:33:21Z","commitID":"e2d5a87b2676e3e01f0f4fa7ebd01205364cfb16","region":"us-east-1","sqsARN":null}}}]
API Reference
API Reference : Service Operations
Full Examples
Full Examples : Service Operations
Contribute
# Functions
DecryptData - decrypts server config data.
EncryptData - encrypts server config data.
ErrInvalidArgument - Invalid argument response.
New - instantiate minio client Client, adds automatic verification of signature.
# Constants
Account status per user.
Account status per user.
Drive state constants.
Drive state constants.
Drive state constants.
Drive state constants.
Multi disk Erasure (single, distributed) backend.
Filesystem backend.
HealDeepScan checks for parts bitrot checksums.
HealItemType constants.
HealItemType constants.
HealItemType constants.
HealItemType constants.
HealNormalScan checks if parts are present and not outdated.
represents Block profiler type.
represents CPU profiler type.
represents MEM profiler type.
represents Mutex profiler type.
represents Trace profiler type.
ServiceActionValueRestart represents restart action.
ServiceActionValueStop represents stop action.
Enum for different backend types.
# Structs
AdminAPIVersionInfo - contains admin API version information.
AdminClient implements Amazon S3 compatible methods.
ErrorResponse - Is the typed error returned by all API operations.
HealDriveInfo - struct for an individual drive info item.
HealOpts - collection of options for a heal sequence.
HealResultItem - struct for an individual heal result item.
HealStartSuccess - holds information about a successfully started heal operation.
HealTaskStatus - status struct for a heal task.
LockEntry holds information about client requesting the lock, servers holding the lock, source on the client machine, ID, type(read or write) and time stamp.
ServerConnStats holds network information.
ServerCPULoadInfo holds information about address and cpu load of a single server node.
ServerDrivesPerfInfo holds informantion about address and write speed of all drives in a single server node.
ServerHTTPMethodStats holds total number of HTTP operations from/to the server, including the average duration the call was spent.
ServerHTTPStats holds all type of http operations performed to/from the server including their average execution time.
ServerInfo holds server information result of one node.
ServerInfoData holds storage, connections and other information of a given server.
ServerMemUsageInfo holds information about address and memory utilization of a single server node.
ServerProperties holds some of the server's information such as uptime, version, region, ..
ServerVersion - server version.
ServiceAction - represents POST body for service action APIs.
ServiceStatus - contains the response of service status API.
SetCredsReq - xml to send to the server to set new credentials.
StartProfilingResult holds the result of starting profiler result in a given node.
StorageInfo - represents total capacity of underlying storage.
UserInfo carries information about long term users.
# Type aliases
AccountStatus - account status.
BackendType - represents different backend types.
DriveInfo - represents each drive info, describing status, uuid and endpoint.
HealItemType - specify the type of heal operation in a healing result.
HealScanMode represents the type of healing scan.
HealStopSuccess - holds information about a successfully stopped heal operation.
LockEntries - To sort the locks.
ProfilerType represents the profiler type passed to the profiler subsystem.
ServiceActionValue - type to restrict service-action values.