madmin

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 58 Imported by: 0

README

Golang Admin Client API Reference Slack

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.

Initialize MinIO Admin Client object.

MinIO


package main

import (
    "fmt"

    "github.com/87ZGitHub/madmin-go"
)

func main() {
    // Use a secure connection.
    ssl := true

    // Initialize minio client object.
    mdmClnt, err := madmin.New("your-minio.example.com:9000", "YOUR-ACCESSKEYID", "YOUR-SECRETKEY", ssl)
    if err != nil {
        fmt.Println(err)
        return
    }

    // Fetch service status.
    st, err := mdmClnt.ServerInfo()
    if err != nil {
        fmt.Println(err)
        return
    }
	for _, peerInfo := range serversInfo {
		log.Printf("Node: %s, Info: %v\n", peerInfo.Addr, peerInfo.Data)
	}
}

Service operations Info operations Healing operations Config operations
ServiceTrace ServerInfo Heal GetConfig
ServiceStop StorageInfo SetConfig
ServiceRestart AccountInfo
Top operations IAM operations Misc KMS
TopLocks AddUser StartProfiling GetKeyStatus
SetPolicy DownloadProfilingData
ListUsers ServerUpdate
AddCannedPolicy

1. Constructor

New(endpoint string, accessKeyID string, secretAccessKey string, ssl bool) (*AdminClient, error)

Initializes a new admin client object.

Parameters

Param Type Description
endpoint string MinIO endpoint.
accessKeyID string Access key for the object storage endpoint.
secretAccessKey string Secret key for the object storage endpoint.
ssl bool Set this value to 'true' to enable secure (HTTPS) access.

2. Service operations

ServiceStatus(ctx context.Context) (ServiceStatusMetadata, error)

Fetch service status, replies disk space used, backend type and total disks offline/online (applicable in distributed mode).

Param Type Description
serviceStatus ServiceStatusMetadata Represents current server status info in following format:
Param Type Description
st.ServerVersion.Version string Server version.
st.ServerVersion.CommitID string Server commit id.
st.Uptime time.Duration Server uptime duration in seconds.

Example


   st, err := madmClnt.ServiceStatus(context.Background())
   if err != nil {
   	log.Fatalln(err)
   }
   log.Printf("%#v\n", st)

ServiceRestart(ctx context.Context) error

Sends a service action restart command to MinIO server.

Example

   // To restart the service, restarts all servers in the cluster.
   err := madmClnt.ServiceRestart(context.Background())
   if err != nil {
       log.Fatalln(err)
   }
   log.Println("Success")

ServiceStop(ctx context.Context) error

Sends a service action stop command to MinIO server.

Example

   // To stop the service, stops all servers in the cluster.
   err := madmClnt.ServiceStop(context.Background())
   if err != nil {
       log.Fatalln(err)
   }
   log.Println("Success")

ServiceTrace(ctx context.Context, allTrace bool, doneCh <-chan struct{}) <-chan TraceInfo

Enable HTTP request tracing on all nodes in a MinIO cluster

Example

    doneCh := make(chan struct{})
    defer close(doneCh)
    // listen to all trace including internal API calls
    allTrace := true
    // Start listening on all trace activity.
    traceCh := madmClnt.ServiceTrace(context.Background(), allTrace, doneCh)
    for traceInfo := range traceCh {
        fmt.Println(traceInfo.String())
    }

3. Info operations

ServerInfo(ctx context.Context) ([]ServerInfo, error)

Fetches information for all cluster nodes, such as server properties, storage information, network statistics, etc.

Param Type Description
si.Addr string Address of the server the following information is retrieved from.
si.ConnStats ServerConnStats Connection statistics from the given server.
si.HTTPStats ServerHTTPStats HTTP connection statistics from the given server.
si.Properties ServerProperties Server properties such as region, notification targets.
Param Type Description
ServerProperties.Uptime time.Duration Total duration in seconds since server is running.
ServerProperties.Version string Current server version.
ServerProperties.CommitID string Current server commitID.
ServerProperties.Region string Configured server region.
ServerProperties.SQSARN []string List of notification target ARNs.
Param Type Description
ServerConnStats.TotalInputBytes uint64 Total bytes received by the server.
ServerConnStats.TotalOutputBytes uint64 Total bytes sent by the server.
Param Type Description
ServerHTTPStats.TotalHEADStats ServerHTTPMethodStats Total statistics regarding HEAD operations
ServerHTTPStats.SuccessHEADStats ServerHTTPMethodStats Total statistics regarding successful HEAD operations
ServerHTTPStats.TotalGETStats ServerHTTPMethodStats Total statistics regarding GET operations
ServerHTTPStats.SuccessGETStats ServerHTTPMethodStats Total statistics regarding successful GET operations
ServerHTTPStats.TotalPUTStats ServerHTTPMethodStats Total statistics regarding PUT operations
ServerHTTPStats.SuccessPUTStats ServerHTTPMethodStats Total statistics regarding successful PUT operations
ServerHTTPStats.TotalPOSTStats ServerHTTPMethodStats Total statistics regarding POST operations
ServerHTTPStats.SuccessPOSTStats ServerHTTPMethodStats Total statistics regarding successful POST operations
ServerHTTPStats.TotalDELETEStats ServerHTTPMethodStats Total statistics regarding DELETE operations
ServerHTTPStats.SuccessDELETEStats ServerHTTPMethodStats Total statistics regarding successful DELETE operations
Param Type Description
ServerHTTPMethodStats.Count uint64 Total number of operations.
ServerHTTPMethodStats.AvgDuration string Average duration of Count number of operations.
Param Type Description
DriveInfo.UUID string Unique ID for each disk provisioned by server format.
DriveInfo.Endpoint string Endpoint location of the remote/local disk.
DriveInfo.State string Current state of the disk at endpoint.

Example


   serversInfo, err := madmClnt.ServerInfo(context.Background())
   if err != nil {
   	log.Fatalln(err)
   }

   for _, peerInfo := range serversInfo {
   	log.Printf("Node: %s, Info: %v\n", peerInfo.Addr, peerInfo.Data)
   }

StorageInfo(ctx context.Context) (StorageInfo, error)

Fetches Storage information for all cluster nodes.

Param Type Description
storageInfo.Used []int64 Used disk spaces.
storageInfo.Total []int64 Total disk spaces.
storageInfo.Available []int64 Available disk spaces.
StorageInfo.Backend struct{} Represents backend type embedded structure.
Param Type Description
Backend.Type BackendType Type of backend used by the server currently only FS or Erasure.
Backend.OnlineDisks BackendDisks Total number of disks online per node (only applies to Erasure backend) represented in map[string]int, is empty for FS.
Backend.OfflineDisks BackendDisks Total number of disks offline per node (only applies to Erasure backend) represented in map[string]int, is empty for FS.
Backend.StandardSCParity int Parity disks set for standard storage class, is empty for FS.
Backend.RRSCParity int Parity disks set for reduced redundancy storage class, is empty for FS.
Backend.Sets [][]DriveInfo Represents topology of drives in erasure coded sets.

Example


   storageInfo, err := madmClnt.StorageInfo(context.Background())
   if err != nil {
   	log.Fatalln(err)
   }

   log.Println(storageInfo)

AccountInfo(ctx context.Context) (AccountInfo, error)

Fetches accounting usage information for the current authenticated user

Param Type Description
AccountInfo.AccountName string Account name.
AccountInfo.Buckets []BucketAccessInfo Bucket usage info.
Param Type Description
BucketAccessInfo.Name string The name of the current bucket
BucketAccessInfo.Size uint64 The total size of the current bucket
BucketAccessInfo.Created time.Time Bucket creation time
BucketAccessInfo.Access AccountAccess Type of access of the current account
Param Type Description
AccountAccess.Read bool Indicate if the bucket is readable by the current account name.
AccountAccess.Write bool Indocate if the bucket is writable by the current account name.

Example


   accountInfo, err := madmClnt.AccountInfo(context.Background())
   if err != nil {
	log.Fatalln(err)
   }

   log.Println(accountInfo)

5. Heal operations

Heal(ctx context.Context, bucket, prefix string, healOpts HealOpts, clientToken string, forceStart bool, forceStop bool) (start HealStartSuccess, status HealTaskStatus, err error)

Start a heal sequence that scans data under given (possible empty) bucket and prefix. The recursive bool turns on recursive traversal under the given path. dryRun does not mutate on-disk data, but performs data validation.

Two heal sequences on overlapping paths may not be initiated.

The progress of a heal should be followed using the same API Heal by providing the clientToken previously obtained from a Heal API. The server accumulates results of the heal traversal and waits for the client to receive and acknowledge them using the status request by providing clientToken.

Example


    opts := madmin.HealOpts{
            Recursive: true,
            DryRun:    false,
    }
    forceStart := false
    forceStop := false
    healPath, err := madmClnt.Heal(context.Background(), "", "", opts, "", forceStart, forceStop)
    if err != nil {
        log.Fatalln(err)
    }
    log.Printf("Heal sequence started at %s", healPath)

HealStartSuccess structure
Param Type Description
s.ClientToken string A unique token for a successfully started heal operation, this token is used to request realtime progress of the heal operation.
s.ClientAddress string Address of the client which initiated the heal operation, the client address has the form "host:port".
s.StartTime time.Time Time when heal was initially started.
HealTaskStatus structure
Param Type Description
s.Summary string Short status of heal sequence
s.FailureDetail string Error message in case of heal sequence failure
s.HealSettings HealOpts Contains the booleans set in the HealStart call
s.Items []HealResultItem Heal records for actions performed by server
HealResultItem structure
Param Type Description
ResultIndex int64 Index of the heal-result record
Type HealItemType Represents kind of heal operation in the heal record
Bucket string Bucket name
Object string Object name
Detail string Details about heal operation
DiskInfo.AvailableOn []int List of disks on which the healed entity is present and healthy
DiskInfo.HealedOn []int List of disks on which the healed entity was restored
l

6. Config operations

GetConfig(ctx context.Context) ([]byte, error)

Get current config.json of a MinIO server.

Example

    configBytes, err := madmClnt.GetConfig(context.Background())
    if err != nil {
        log.Fatalf("failed due to: %v", err)
    }

    // Pretty-print config received as json.
    var buf bytes.Buffer
    err = json.Indent(buf, configBytes, "", "\t")
    if err != nil {
        log.Fatalf("failed due to: %v", err)
    }

    log.Println("config received successfully: ", string(buf.Bytes()))

SetConfig(ctx context.Context, config io.Reader) error

Set a new config.json for a MinIO server.

Example

    config := bytes.NewReader([]byte(`config.json contents go here`))
    if err := madmClnt.SetConfig(context.Background(), config); err != nil {
        log.Fatalf("failed due to: %v", err)
    }
    log.Println("SetConfig was successful")

7. Top operations

TopLocks(ctx context.Context) (LockEntries, error)

Get the oldest locks from MinIO server.

Example

    locks, err := madmClnt.TopLocks(context.Background())
    if err != nil {
        log.Fatalf("failed due to: %v", err)
    }

    out, err := json.Marshal(locks)
    if err != nil {
        log.Fatalf("Marshal failed due to: %v", err)
    }

    log.Println("TopLocks received successfully: ", string(out))

8. IAM operations

AddCannedPolicy(ctx context.Context, policyName string, policy *iampolicy.Policy) error

Create a new canned policy on MinIO server.

Example

	policy, err := iampolicy.ParseConfig(strings.NewReader(`{"Version": "2012-10-17","Statement": [{"Action": ["s3:GetObject"],"Effect": "Allow","Resource": ["arn:aws:s3:::my-bucketname/*"],"Sid": ""}]}`))
    if err != nil {
        log.Fatalln(err)
    }

    if err = madmClnt.AddCannedPolicy(context.Background(), "get-only", policy); err != nil {
		log.Fatalln(err)
	}

AddUser(ctx context.Context, user string, secret string) error

Add a new user on a MinIO server.

Example

	if err = madmClnt.AddUser(context.Background(), "newuser", "newstrongpassword"); err != nil {
		log.Fatalln(err)
	}

SetPolicy(ctx context.Context, policyName, entityName string, isGroup bool) error

Enable a canned policy get-only for a given user or group on MinIO server.

Example

	if err = madmClnt.SetPolicy(context.Background(), "get-only", "newuser", false); err != nil {
		log.Fatalln(err)
	}

ListUsers(ctx context.Context) (map[string]UserInfo, error)

Lists all users on MinIO server.

Example

	users, err := madmClnt.ListUsers(context.Background());
    if err != nil {
		log.Fatalln(err)
	}
    for k, v := range users {
        fmt.Printf("User %s Status %s\n", k, v.Status)
    }

9. Misc operations

ServerUpdate(ctx context.Context, updateURL string) (ServerUpdateStatus, error)

Sends a update command to MinIO server, to update MinIO server to latest release. In distributed setup it updates all servers atomically.

Example

   // Updates all servers and restarts all the servers in the cluster.
   // optionally takes an updateURL, which is used to update the binary.
   us, err := madmClnt.ServerUpdate(context.Background(), updateURL)
   if err != nil {
       log.Fatalln(err)
   }
   if us.CurrentVersion != us.UpdatedVersion {
       log.Printf("Updated server version from %s to %s successfully", us.CurrentVersion, us.UpdatedVersion)
   }

StartProfiling(ctx context.Context, profiler string) error

Ask all nodes to start profiling using the specified profiler mode

Example

    startProfilingResults, err = madmClnt.StartProfiling(context.Background(), "cpu")
    if err != nil {
            log.Fatalln(err)
    }
    for _, result := range startProfilingResults {
        if !result.Success {
            log.Printf("Unable to start profiling on node `%s`, reason = `%s`\n", result.NodeName, result.Error)
        } else {
            log.Printf("Profiling successfully started on node `%s`\n", result.NodeName)
        }
    }

DownloadProfilingData(ctx context.Context) ([]byte, error)

Download profiling data of all nodes in a zip format.

Example

    profilingData, err := madmClnt.DownloadProfilingData(context.Background())
    if err != nil {
            log.Fatalln(err)
    }

    profilingFile, err := os.Create("/tmp/profiling-data.zip")
    if err != nil {
            log.Fatal(err)
    }

    if _, err := io.Copy(profilingFile, profilingData); err != nil {
            log.Fatal(err)
    }

    if err := profilingFile.Close(); err != nil {
            log.Fatal(err)
    }

    if err := profilingData.Close(); err != nil {
            log.Fatal(err)
    }

    log.Println("Profiling data successfully downloaded.")

11. KMS

GetKeyStatus(ctx context.Context, keyID string) (*KMSKeyStatus, error)

Requests status information about one particular KMS master key from a MinIO server. The keyID is optional and the server will use the default master key (configured via MINIO_KMS_VAULT_KEY_NAME or MINIO_KMS_MASTER_KEY) if the keyID is empty.

Example

    keyInfo, err := madmClnt.GetKeyStatus(context.Background(), "my-minio-key")
    if err != nil {
       log.Fatalln(err)
    }
    if keyInfo.EncryptionErr != "" {
       log.Fatalf("Failed to perform encryption operation using '%s': %v\n", keyInfo.KeyID, keyInfo.EncryptionErr)
    }
    if keyInfo.UpdateErr != "" {
       log.Fatalf("Failed to perform key re-wrap operation using '%s': %v\n", keyInfo.KeyID, keyInfo.UpdateErr)
    }
    if keyInfo.DecryptionErr != "" {
       log.Fatalf("Failed to perform decryption operation using '%s': %v\n", keyInfo.KeyID, keyInfo.DecryptionErr)
    }

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE.

Documentation

Index

Examples

Constants

View Source
const (
	ReplicateAddStatusSuccess = "Requested sites were configured for replication successfully."
	ReplicateAddStatusPartial = "Some sites could not be configured for replication."
)

Meaningful values for ReplicateAddStatus.Status

View Source
const (
	SRIAMItemPolicy        = "policy"
	SRIAMItemSvcAcc        = "service-account"
	SRIAMItemSTSAcc        = "sts-account"
	SRIAMItemPolicyMapping = "policy-mapping"
	SRIAMItemIAMUser       = "iam-user"
	SRIAMItemGroupInfo     = "group-info"
)

SRIAMItem.Type constants.

View Source
const (
	SRBucketMetaTypePolicy           = "policy"
	SRBucketMetaTypeTags             = "tags"
	SRBucketMetaTypeVersionConfig    = "version-config"
	SRBucketMetaTypeObjectLockConfig = "object-lock-config"
	SRBucketMetaTypeSSEConfig        = "sse-config"
	SRBucketMetaTypeQuotaConfig      = "quota-config"
)

SRBucketMeta.Type constants

View Source
const (
	ReplicateRemoveStatusSuccess = "Requested site(s) were removed from cluster replication successfully."
	ReplicateRemoveStatusPartial = "Some site(s) could not be removed from cluster replication configuration."
)
View Source
const (
	// ConfigAppliedHeader is the header indicating whether the config was applied without requiring a restart.
	ConfigAppliedHeader = "x-minio-config-applied"

	// ConfigAppliedTrue is the value set in header if the config was applied.
	ConfigAppliedTrue = "true"
)
View Source
const (
	HealItemMetadata       HealItemType = "metadata"
	HealItemBucket                      = "bucket"
	HealItemBucketMetadata              = "bucket-metadata"
	HealItemObject                      = "object"
)

HealItemType constants

View Source
const (
	DriveStateOk          string = "ok"
	DriveStateOffline            = "offline"
	DriveStateCorrupt            = "corrupt"
	DriveStateMissing            = "missing"
	DriveStatePermission         = "permission-denied"
	DriveStateFaulty             = "faulty"
	DriveStateUnknown            = "unknown"
	DriveStateUnformatted        = "unformatted" // only returned by disk
)

Drive state constants

View Source
const (
	// HealthInfoVersion0 is version 0
	HealthInfoVersion0 = ""
	// HealthInfoVersion1 is version 1
	HealthInfoVersion1 = "1"
	// HealthInfoVersion2 is version 2
	HealthInfoVersion2 = "2"
	// HealthInfoVersion3 is version 3
	HealthInfoVersion3 = "3"
	// HealthInfoVersion is current health info version.
	HealthInfoVersion = HealthInfoVersion3
)
View Source
const (
	SysErrAuditEnabled      = "audit is enabled"
	SysErrUpdatedbInstalled = "updatedb is installed"
)
View Source
const (
	SrvSELinux      = "selinux"
	SrvNotInstalled = "not-installed"
)
View Source
const (

	// ItemOffline indicates that the item is offline
	ItemOffline = ItemState("offline")
	// ItemInitializing indicates that the item is still in initialization phase
	ItemInitializing = ItemState("initializing")
	// ItemOnline indicates that the item is online
	ItemOnline = ItemState("online")
)
View Source
const (
	// FsType - Backend is FS Type
	FsType = backendType("FS")
	// ErasureType - Backend is Erasure type
	ErasureType = backendType("Erasure")
)
View Source
const (
	CredentialsSubSys    = "credentials"
	PolicyOPASubSys      = "policy_opa"
	PolicyPluginSubSys   = "policy_plugin"
	IdentityOpenIDSubSys = "identity_openid"
	IdentityLDAPSubSys   = "identity_ldap"
	IdentityTLSSubSys    = "identity_tls"
	IdentityPluginSubSys = "identity_plugin"
	CacheSubSys          = "cache"
	SiteSubSys           = "site"
	RegionSubSys         = "region"
	EtcdSubSys           = "etcd"
	StorageClassSubSys   = "storage_class"
	APISubSys            = "api"
	CompressionSubSys    = "compression"
	LoggerWebhookSubSys  = "logger_webhook"
	AuditWebhookSubSys   = "audit_webhook"
	AuditKafkaSubSys     = "audit_kafka"
	HealSubSys           = "heal"
	ScannerSubSys        = "scanner"
	CrawlerSubSys        = "crawler"
	SubnetSubSys         = "subnet"
	CallhomeSubSys       = "callhome"

	NotifyKafkaSubSys    = "notify_kafka"
	NotifyMQTTSubSys     = "notify_mqtt"
	NotifyMySQLSubSys    = "notify_mysql"
	NotifyNATSSubSys     = "notify_nats"
	NotifyNSQSubSys      = "notify_nsq"
	NotifyESSubSys       = "notify_elasticsearch"
	NotifyAMQPSubSys     = "notify_amqp"
	NotifyPostgresSubSys = "notify_postgres"
	NotifyRedisSubSys    = "notify_redis"
	NotifyWebhookSubSys  = "notify_webhook"
)

Top level configuration key constants.

View Source
const (
	EnableKey  = "enable"
	CommentKey = "comment"

	// Enable values
	EnableOn  = "on"
	EnableOff = "off"
)

Standard config keys and values.

View Source
const (
	SubSystemSeparator = `:`
	KvSeparator        = `=`
	KvComment          = `#`
	KvSpaceSeparator   = ` `
	KvNewline          = "\n"
	KvDoubleQuote      = `"`
	KvSingleQuote      = `'`

	Default = `_`

	EnvPrefix        = "MINIO_"
	EnvWordDelimiter = `_`

	EnvLinePrefix = KvComment + KvSpaceSeparator + EnvPrefix
)

Constant separators

View Source
const (
	// ServiceActionRestart represents restart action
	ServiceActionRestart ServiceAction = "restart"
	// ServiceActionStop represents stop action
	ServiceActionStop = "stop"
	// ServiceActionFreeze represents freeze action
	ServiceActionFreeze = "freeze"
	// ServiceActionUnfreeze represents unfreeze a previous freeze action
	ServiceActionUnfreeze = "unfreeze"
)
View Source
const (
	AdminAPIVersion   = "v3"
	AdminAPIVersionV2 = "v2"
)

AdminAPIVersion - admin api version used in the request.

View Source
const DefaultRetryCap = time.Second * 30

DefaultRetryCap - Each retry attempt never waits no longer than this maximum time duration.

View Source
const DefaultRetryUnit = time.Second

DefaultRetryUnit - default unit multiplicative per retry. defaults to 1 second.

View Source
const MaxJitter = 1.0

MaxJitter will randomize over the full exponential backoff time

View Source
const NoJitter = 0.0

NoJitter disables the use of jitter for randomizing the exponential backoff time

View Source
const TierConfigVer = "v1"

TierConfigVer refers to the current tier config version

Variables

View Source
var (
	ErrInvalidEnvVarLine = errors.New("expected env var line of the form `# MINIO_...=...`")
	ErrInvalidConfigKV   = errors.New("expected config value in the format `key=value`")
)
View Source
var (
	// ErrTierNameEmpty "remote tier name empty"
	ErrTierNameEmpty = errors.New("remote tier name empty")
	// ErrTierInvalidConfig "invalid tier config"
	ErrTierInvalidConfig = errors.New("invalid tier config")
	// ErrTierInvalidConfigVersion "invalid tier config version"
	ErrTierInvalidConfigVersion = errors.New("invalid tier config version")
	// ErrTierTypeUnsupported "unsupported tier type"
	ErrTierTypeUnsupported = errors.New("unsupported tier type")
)
View Source
var DefaultTransport = func(secure bool) http.RoundTripper {
	tr := &http.Transport{
		Proxy: http.ProxyFromEnvironment,
		DialContext: (&net.Dialer{
			Timeout:       5 * time.Second,
			KeepAlive:     15 * time.Second,
			FallbackDelay: 100 * time.Millisecond,
		}).DialContext,
		MaxIdleConns:          1024,
		MaxIdleConnsPerHost:   1024,
		ResponseHeaderTimeout: 60 * time.Second,
		IdleConnTimeout:       60 * time.Second,
		TLSHandshakeTimeout:   10 * time.Second,
		ExpectContinueTimeout: 1 * time.Second,

		DisableCompression: true,
	}

	if secure {
		tr.TLSClientConfig = &tls.Config{

			MinVersion: tls.VersionTLS12,
		}
	}
	return tr
}

DefaultTransport - this default transport is similar to http.DefaultTransport but with additional param DisableCompression is set to true to avoid decompressing content with 'gzip' encoding.

View Source
var ErrMaliciousData = sio.NotAuthentic

ErrMaliciousData indicates that the stream cannot be decrypted by provided credentials.

HealthDataTypesList - List of health datatypes

View Source
var HealthDataTypesMap = map[string]HealthDataType{
	"driveperf":   HealthDataTypePerfDrive,
	"netperf":     HealthDataTypePerfNet,
	"objperf":     HealthDataTypePerfObj,
	"minioinfo":   HealthDataTypeMinioInfo,
	"minioconfig": HealthDataTypeMinioConfig,
	"syscpu":      HealthDataTypeSysCPU,
	"sysdrivehw":  HealthDataTypeSysDriveHw,
	"sysdocker":   HealthDataTypeSysDocker,
	"sysosinfo":   HealthDataTypeSysOsInfo,
	"sysload":     HealthDataTypeSysLoad,
	"sysmem":      HealthDataTypeSysMem,
	"sysnet":      HealthDataTypeSysNet,
	"sysprocess":  HealthDataTypeSysProcess,
	"syserrors":   HealthDataTypeSysErrors,
	"sysservices": HealthDataTypeSysServices,
	"sysconfig":   HealthDataTypeSysConfig,
}

HealthDataTypesMap - Map of Health datatypes

View Source
var MaxRetry = 10

MaxRetry is the maximum number of retries before stopping.

SubSystems - list of all subsystems in MinIO

Functions

func AzureEndpoint

func AzureEndpoint(endpoint string) func(az *TierAzure) error

AzureEndpoint helper to supply optional endpoint to NewTierAzure

func AzurePrefix

func AzurePrefix(prefix string) func(az *TierAzure) error

AzurePrefix helper to supply optional object prefix to NewTierAzure

func AzureRegion

func AzureRegion(region string) func(az *TierAzure) error

AzureRegion helper to supply optional region to NewTierAzure

func AzureStorageClass

func AzureStorageClass(sc string) func(az *TierAzure) error

AzureStorageClass helper to supply optional storage class to NewTierAzure

func DecryptData

func DecryptData(password string, data io.Reader) ([]byte, error)

DecryptData decrypts the data with the key derived from the salt (part of data) and the password using the PBKDF used in EncryptData. DecryptData returns the decrypted plaintext on success.

The data must be a valid ciphertext produced by EncryptData. Otherwise, the decryption will fail.

func EncryptData

func EncryptData(password string, data []byte) ([]byte, error)

EncryptData encrypts the data with an unique key derived from password using the Argon2id PBKDF.

The returned ciphertext data consists of:

salt | AEAD ID | nonce | encrypted data
 32      1         8      ~ len(data)

func ErrInvalidArgument

func ErrInvalidArgument(message string) error

ErrInvalidArgument - Invalid argument response.

func FIPSEnabled

func FIPSEnabled() bool

FIPSEnabled returns true if and only if FIPS 140-2 support is enabled.

FIPS 140-2 requires that only specifc cryptographic primitives, like AES or SHA-256, are used and that those primitives are implemented by a FIPS 140-2 certified cryptographic module.

func GCSPrefix

func GCSPrefix(prefix string) func(*TierGCS) error

GCSPrefix helper to supply optional object prefix to NewTierGCS

func GCSRegion

func GCSRegion(region string) func(*TierGCS) error

GCSRegion helper to supply optional region to NewTierGCS

func GCSStorageClass

func GCSStorageClass(sc string) func(*TierGCS) error

GCSStorageClass helper to supply optional storage class to NewTierGCS

func HasSpace

func HasSpace(s string) bool

HasSpace - returns if given string has space.

func IsEncrypted

func IsEncrypted(data []byte) bool

IsEncrypted reports whether data is encrypted.

func MinIOPrefix

func MinIOPrefix(prefix string) func(m *TierMinIO) error

MinIOPrefix helper to supply optional object prefix to NewTierMinIO

func MinIORegion

func MinIORegion(region string) func(m *TierMinIO) error

MinIORegion helper to supply optional region to NewTierMinIO

func S3AWSRole

func S3AWSRole() func(s3 *TierS3) error

S3AWSRole helper to use optional AWS Role to NewTierS3

func S3Endpoint

func S3Endpoint(endpoint string) func(s3 *TierS3) error

S3Endpoint helper to supply optional endpoint to NewTierS3

func S3Prefix

func S3Prefix(prefix string) func(s3 *TierS3) error

S3Prefix helper to supply optional object prefix to NewTierS3

func S3Region

func S3Region(region string) func(s3 *TierS3) error

S3Region helper to supply optional region to NewTierS3

func S3StorageClass

func S3StorageClass(storageClass string) func(s3 *TierS3) error

S3StorageClass helper to supply optional storage class to NewTierS3

func SanitizeValue

func SanitizeValue(v string) string

SanitizeValue - this function is needed, to trim off single or double quotes, creeping into the values.

Types

type ARN

type ARN struct {
	Type   ServiceType
	ID     string
	Region string
	Bucket string
}

ARN is a struct to define arn.

func ParseARN

func ParseARN(s string) (*ARN, error)

ParseARN return ARN struct from string in arn format.

func (ARN) Empty

func (a ARN) Empty() bool

Empty returns true if arn struct is empty

func (ARN) String

func (a ARN) String() string

type AccountAccess

type AccountAccess struct {
	Read  bool `json:"read"`
	Write bool `json:"write"`
}

AccountAccess contains information about

type AccountInfo

type AccountInfo struct {
	AccountName string
	Server      BackendInfo
	Policy      json.RawMessage // Use iam/policy.Parse to parse the result, to be done by the caller.
	Buckets     []BucketAccessInfo
}

AccountInfo represents the account usage info of an account across buckets.

type AccountOpts

type AccountOpts struct {
	PrefixUsage bool
}

AccountOpts allows for configurable behavior with "prefix-usage"

type AccountStatus

type AccountStatus string

AccountStatus - account status.

const (
	AccountEnabled  AccountStatus = "enabled"
	AccountDisabled AccountStatus = "disabled"
)

Account status per user.

type AddOrUpdateUserReq

type AddOrUpdateUserReq struct {
	SecretKey string        `json:"secretKey,omitempty"`
	Status    AccountStatus `json:"status"`
}

AddOrUpdateUserReq allows to update user details such as secret key and account status.

type AddServiceAccountReq

type AddServiceAccountReq struct {
	Policy     json.RawMessage `json:"policy,omitempty"` // Parsed value from iam/policy.Parse()
	TargetUser string          `json:"targetUser,omitempty"`
	AccessKey  string          `json:"accessKey,omitempty"`
	SecretKey  string          `json:"secretKey,omitempty"`
}

AddServiceAccountReq is the request options of the add service account admin call

type AddServiceAccountResp

type AddServiceAccountResp struct {
	Credentials Credentials `json:"credentials"`
}

AddServiceAccountResp is the response body of the add service account admin call

type AdminClient

type AdminClient struct {
	// contains filtered or unexported fields
}

AdminClient implements Amazon S3 compatible methods.

func New

func New(endpoint string, accessKeyID, secretAccessKey string, secure bool) (*AdminClient, error)

New - instantiate minio admin client

func NewWithOptions

func NewWithOptions(endpoint string, opts *Options) (*AdminClient, error)

NewWithOptions - instantiate minio admin client with options.

func (*AdminClient) AccountInfo

func (adm *AdminClient) AccountInfo(ctx context.Context, opts AccountOpts) (AccountInfo, error)

AccountInfo returns the usage info for the authenticating account.

func (*AdminClient) AddCannedPolicy

func (adm *AdminClient) AddCannedPolicy(ctx context.Context, policyName string, policy []byte) error

AddCannedPolicy - adds a policy for a canned.

func (*AdminClient) AddServiceAccount

func (adm *AdminClient) AddServiceAccount(ctx context.Context, opts AddServiceAccountReq) (Credentials, error)

AddServiceAccount - creates a new service account belonging to the user sending the request while restricting the service account permission by the given policy document.

func (*AdminClient) AddTier

func (adm *AdminClient) AddTier(ctx context.Context, cfg *TierConfig) error

AddTier adds a new remote tier.

func (*AdminClient) AddUser

func (adm *AdminClient) AddUser(ctx context.Context, accessKey, secretKey string) error

AddUser - adds a user.

func (*AdminClient) BackgroundHealStatus

func (adm *AdminClient) BackgroundHealStatus(ctx context.Context) (BgHealState, error)

BackgroundHealStatus returns the background heal status of the current server or cluster.

func (*AdminClient) BucketReplicationDiff

func (adm *AdminClient) BucketReplicationDiff(ctx context.Context, bucketName string, opts ReplDiffOpts) <-chan DiffInfo

BucketReplicationDiff - gets diff for non-replicated entries.

func (*AdminClient) CancelDecommissionPool

func (adm *AdminClient) CancelDecommissionPool(ctx context.Context, pool string) error

CancelDecommissionPool - cancels an on-going decommissioning process, this automatically makes the pool available for writing once canceled.

func (*AdminClient) ClearConfigHistoryKV

func (adm *AdminClient) ClearConfigHistoryKV(ctx context.Context, restoreID string) (err error)

ClearConfigHistoryKV - clears the config entry represented by restoreID. optionally allows setting `all` as a special keyword to automatically erase all config set history entires.

func (*AdminClient) CreateKey

func (adm *AdminClient) CreateKey(ctx context.Context, keyID string) error

CreateKey tries to create a new master key with the given keyID at the KMS connected to a MinIO server.

func (*AdminClient) DataUsageInfo

func (adm *AdminClient) DataUsageInfo(ctx context.Context) (DataUsageInfo, error)

DataUsageInfo - returns data usage of the current object API

func (*AdminClient) DecommissionPool

func (adm *AdminClient) DecommissionPool(ctx context.Context, pool string) error

DecommissionPool - starts moving data from specified pool to all other existing pools. Decommissioning if successfully started this function will return `nil`, to check for on-going draining cycle use StatusPool.

func (*AdminClient) DelConfigKV

func (adm *AdminClient) DelConfigKV(ctx context.Context, k string) (restart bool, err error)

DelConfigKV - delete key from server config.

func (*AdminClient) DeleteIDPConfig

func (adm *AdminClient) DeleteIDPConfig(ctx context.Context, cfgType, cfgName string) (restart bool, err error)

DeleteIDPConfig - delete an IDP configuration on the server.

func (*AdminClient) DeleteServiceAccount

func (adm *AdminClient) DeleteServiceAccount(ctx context.Context, serviceAccount string) error

DeleteServiceAccount - delete a specified service account. The server will reject the request if the service account does not belong to the user initiating the request

func (*AdminClient) DownloadProfilingData

func (adm *AdminClient) DownloadProfilingData(ctx context.Context) (io.ReadCloser, error)

DownloadProfilingData makes an admin call to download profiling data of a standalone server or of the whole cluster in case of a distributed setup. Deprecated: use Profile API instead

func (*AdminClient) DriveSpeedtest

func (adm *AdminClient) DriveSpeedtest(ctx context.Context, opts DriveSpeedTestOpts) (chan DriveSpeedTestResult, error)

DriveSpeedtest - perform drive speedtest on the MinIO servers

func (*AdminClient) EditTier

func (adm *AdminClient) EditTier(ctx context.Context, tierName string, creds TierCreds) error

EditTier supports updating credentials for the remote tier identified by tierName.

func (AdminClient) ExecuteMethod

func (adm AdminClient) ExecuteMethod(ctx context.Context, method string, reqData RequestData) (res *http.Response, err error)

ExecuteMethod - similar to internal method executeMethod() useful for writing custom requests.

func (*AdminClient) ExportBucketMetadata

func (adm *AdminClient) ExportBucketMetadata(ctx context.Context, bucket string) (io.ReadCloser, error)

ExportBucketMetadata makes an admin call to export bucket metadata of a bucket

func (*AdminClient) ExportIAM

func (adm *AdminClient) ExportIAM(ctx context.Context) (io.ReadCloser, error)

ExportIAM makes an admin call to export IAM data

func (*AdminClient) ForceUnlock

func (adm *AdminClient) ForceUnlock(ctx context.Context, paths ...string) error

ForceUnlock force unlocks input paths...

func (AdminClient) GetAccessAndSecretKey

func (adm AdminClient) GetAccessAndSecretKey() (string, string)

GetAccessAndSecretKey - retrieves the access and secret keys.

func (*AdminClient) GetBucketBandwidth

func (adm *AdminClient) GetBucketBandwidth(ctx context.Context, buckets ...string) <-chan Report

GetBucketBandwidth - Gets a channel reporting bandwidth measurements for replication buckets. If no buckets generate replication traffic an empty map is returned in the report until traffic is seen.

func (*AdminClient) GetBucketQuota

func (adm *AdminClient) GetBucketQuota(ctx context.Context, bucket string) (q BucketQuota, err error)

GetBucketQuota - get info on a user

func (*AdminClient) GetConfig

func (adm *AdminClient) GetConfig(ctx context.Context) ([]byte, error)

GetConfig - returns the config.json of a minio setup, incoming data is encrypted.

func (*AdminClient) GetConfigKV

func (adm *AdminClient) GetConfigKV(ctx context.Context, key string) ([]byte, error)

GetConfigKV - returns the key, value of the requested key, incoming data is encrypted.

func (*AdminClient) GetConfigKVWithOptions

func (adm *AdminClient) GetConfigKVWithOptions(ctx context.Context, key string, opts KVOptions) ([]byte, error)

GetConfigKVWithOptions - returns the key, value of the requested key, incoming data is encrypted.

func (AdminClient) GetEndpointURL

func (adm AdminClient) GetEndpointURL() *url.URL

GetEndpointURL - returns the endpoint for the admin client.

func (*AdminClient) GetGroupDescription

func (adm *AdminClient) GetGroupDescription(ctx context.Context, group string) (*GroupDesc, error)

GetGroupDescription - fetches information on a group.

func (*AdminClient) GetIDPConfig

func (adm *AdminClient) GetIDPConfig(ctx context.Context, cfgType, cfgName string) (c IDPConfig, err error)

GetIDPConfig - fetch IDP config from server.

func (*AdminClient) GetKeyStatus

func (adm *AdminClient) GetKeyStatus(ctx context.Context, keyID string) (*KMSKeyStatus, error)

GetKeyStatus requests status information about the key referenced by keyID from the KMS connected to a MinIO by performing a Admin-API request. It basically hits the `/minio/admin/v3/kms/key/status` API endpoint.

func (AdminClient) GetLogs

func (adm AdminClient) GetLogs(ctx context.Context, node string, lineCnt int, logKind string) <-chan LogInfo

GetLogs - listen on console log messages.

func (*AdminClient) GetUserInfo

func (adm *AdminClient) GetUserInfo(ctx context.Context, name string) (u UserInfo, err error)

GetUserInfo - get info on a user

func (*AdminClient) Heal

func (adm *AdminClient) Heal(ctx context.Context, bucket, prefix string,
	healOpts HealOpts, clientToken string, forceStart, forceStop bool) (
	healStart HealStartSuccess, healTaskStatus HealTaskStatus, err error,
)

Heal - API endpoint to start heal and to fetch status forceStart and forceStop are mutually exclusive, you can either set one of them to 'true'. If both are set 'forceStart' will be honored.

func (*AdminClient) HelpConfigKV

func (adm *AdminClient) HelpConfigKV(ctx context.Context, subSys, key string, envOnly bool) (Help, error)

HelpConfigKV - return help for a given sub-system.

func (*AdminClient) ImportBucketMetadata

func (adm *AdminClient) ImportBucketMetadata(ctx context.Context, bucket string, contentReader io.ReadCloser) (r BucketMetaImportErrs, err error)

ImportBucketMetadata makes an admin call to set bucket metadata of a bucket from imported content

func (*AdminClient) ImportIAM

func (adm *AdminClient) ImportIAM(ctx context.Context, contentReader io.ReadCloser) error

ImportIAM makes an admin call to setup IAM from imported content

func (*AdminClient) InfoCannedPolicy

func (adm *AdminClient) InfoCannedPolicy(ctx context.Context, policyName string) ([]byte, error)

InfoCannedPolicy - expand canned policy into JSON structure.

To be DEPRECATED in favor of the implementation in InfoCannedPolicyV2

func (*AdminClient) InfoCannedPolicyV2

func (adm *AdminClient) InfoCannedPolicyV2(ctx context.Context, policyName string) (*PolicyInfo, error)

InfoCannedPolicyV2 - get info on a policy including timestamps and policy json.

func (*AdminClient) InfoServiceAccount

func (adm *AdminClient) InfoServiceAccount(ctx context.Context, accessKey string) (InfoServiceAccountResp, error)

InfoServiceAccount - returns the info of service account belonging to the specified user

func (*AdminClient) Inspect

func (adm *AdminClient) Inspect(ctx context.Context, d InspectOptions) (key [32]byte, c io.ReadCloser, err error)

Inspect makes an admin call to download a raw files from disk.

func (*AdminClient) KMSStatus

func (adm *AdminClient) KMSStatus(ctx context.Context) (KMSStatus, error)

KMSStatus returns status information about the KMS connected to the MinIO server, if configured.

func (*AdminClient) ListCannedPolicies

func (adm *AdminClient) ListCannedPolicies(ctx context.Context) (map[string]json.RawMessage, error)

ListCannedPolicies - list all configured canned policies.

func (*AdminClient) ListConfigHistoryKV

func (adm *AdminClient) ListConfigHistoryKV(ctx context.Context, count int) ([]ConfigHistoryEntry, error)

ListConfigHistoryKV - lists a slice of ConfigHistoryEntries sorted by createTime.

func (*AdminClient) ListGroups

func (adm *AdminClient) ListGroups(ctx context.Context) ([]string, error)

ListGroups - lists all groups names present on the server.

func (*AdminClient) ListIDPConfig

func (adm *AdminClient) ListIDPConfig(ctx context.Context, cfgType string) ([]IDPListItem, error)

ListIDPConfig - list IDP configuration on the server.

func (*AdminClient) ListPoolsStatus

func (adm *AdminClient) ListPoolsStatus(ctx context.Context) ([]PoolStatus, error)

ListPoolsStatus returns list of pools currently configured and being used on the cluster.

func (*AdminClient) ListRemoteTargets

func (adm *AdminClient) ListRemoteTargets(ctx context.Context, bucket, arnType string) (targets []BucketTarget, err error)

ListRemoteTargets - gets target(s) for this bucket

func (*AdminClient) ListServiceAccounts

func (adm *AdminClient) ListServiceAccounts(ctx context.Context, user string) (ListServiceAccountsResp, error)

ListServiceAccounts - list service accounts belonging to the specified user

func (*AdminClient) ListTiers

func (adm *AdminClient) ListTiers(ctx context.Context) ([]*TierConfig, error)

ListTiers returns a list of remote tiers configured.

func (*AdminClient) ListUsers

func (adm *AdminClient) ListUsers(ctx context.Context) (map[string]UserInfo, error)

ListUsers - list all users.

func (*AdminClient) Metrics

func (adm *AdminClient) Metrics(ctx context.Context, o MetricsOptions, out func(RealtimeMetrics)) (err error)

Metrics makes an admin call to retrieve metrics. The provided function is called for each received entry.

func (*AdminClient) Netperf

func (adm *AdminClient) Netperf(ctx context.Context, duration time.Duration) (result NetperfResult, err error)

Netperf - perform netperf on the MinIO servers

func (*AdminClient) Profile

func (adm *AdminClient) Profile(ctx context.Context, profiler ProfilerType, duration time.Duration) (io.ReadCloser, error)

Profile makes an admin call to remotely start profiling on a standalone server or the whole cluster in case of a distributed setup for a specified duration.

func (*AdminClient) RemoveCannedPolicy

func (adm *AdminClient) RemoveCannedPolicy(ctx context.Context, policyName string) error

RemoveCannedPolicy - remove a policy for a canned.

func (*AdminClient) RemoveRemoteTarget

func (adm *AdminClient) RemoveRemoteTarget(ctx context.Context, bucket, arn string) error

RemoveRemoteTarget removes a remote target associated with particular ARN for this bucket

func (*AdminClient) RemoveTier

func (adm *AdminClient) RemoveTier(ctx context.Context, tierName string) error

RemoveTier removes an empty tier identified by tierName

func (*AdminClient) RemoveUser

func (adm *AdminClient) RemoveUser(ctx context.Context, accessKey string) error

RemoveUser - remove a user.

func (*AdminClient) RestoreConfigHistoryKV

func (adm *AdminClient) RestoreConfigHistoryKV(ctx context.Context, restoreID string) (err error)

RestoreConfigHistoryKV - Restore a previous config set history. Input is a unique id which represents the previous setting.

func (*AdminClient) SRMetaInfo

func (adm *AdminClient) SRMetaInfo(ctx context.Context, opts SRStatusOptions) (info SRInfo, err error)

SRMetaInfo - returns replication metadata info for a site.

func (*AdminClient) SRPeerBucketOps

func (adm *AdminClient) SRPeerBucketOps(ctx context.Context, bucket string, op BktOp, opts map[string]string) error

SRPeerBucketOps - tells peers to create bucket and setup replication.

func (*AdminClient) SRPeerEdit

func (adm *AdminClient) SRPeerEdit(ctx context.Context, pi PeerInfo) error

SRPeerEdit - used only by minio server to update peer endpoint for a server already in the site replication setup

func (*AdminClient) SRPeerGetIDPSettings

func (adm *AdminClient) SRPeerGetIDPSettings(ctx context.Context) (info IDPSettings, err error)

SRPeerGetIDPSettings - fetches IDP settings from the server.

func (*AdminClient) SRPeerJoin

func (adm *AdminClient) SRPeerJoin(ctx context.Context, r SRPeerJoinReq) error

SRPeerJoin - used only by minio server to send SR join requests to peer servers.

func (*AdminClient) SRPeerRemove

func (adm *AdminClient) SRPeerRemove(ctx context.Context, removeReq SRRemoveReq) (st ReplicateRemoveStatus, err error)

SRPeerRemove - used only by minio server to unlink cluster replication for a server already in the site replication setup

func (*AdminClient) SRPeerReplicateBucketMeta

func (adm *AdminClient) SRPeerReplicateBucketMeta(ctx context.Context, item SRBucketMeta) error

SRPeerReplicateBucketMeta - copies a bucket metadata change to a peer cluster.

func (*AdminClient) SRPeerReplicateIAMItem

func (adm *AdminClient) SRPeerReplicateIAMItem(ctx context.Context, item SRIAMItem) error

SRPeerReplicateIAMItem - copies an IAM object to a peer cluster.

func (*AdminClient) SRStatusInfo

func (adm *AdminClient) SRStatusInfo(ctx context.Context, opts SRStatusOptions) (info SRStatusInfo, err error)

SRStatusInfo - returns site replication status

func (*AdminClient) ServerHealthInfo

func (adm *AdminClient) ServerHealthInfo(ctx context.Context, types []HealthDataType, deadline time.Duration) (*http.Response, string, error)

ServerHealthInfo - Connect to a minio server and call Health Info Management API to fetch server's information represented by HealthInfo structure

func (*AdminClient) ServerInfo

func (adm *AdminClient) ServerInfo(ctx context.Context) (InfoMessage, error)

ServerInfo - Connect to a minio server and call Server Admin Info Management API to fetch server's information represented by infoMessage structure

func (*AdminClient) ServerUpdate

func (adm *AdminClient) ServerUpdate(ctx context.Context, updateURL string) (us ServerUpdateStatus, err error)

ServerUpdate - updates and restarts the MinIO cluster to latest version. optionally takes an input URL to specify a custom update binary link

func (*AdminClient) ServiceFreeze

func (adm *AdminClient) ServiceFreeze(ctx context.Context) error

ServiceFreeze - freezes all incoming S3 API calls on MinIO cluster

func (*AdminClient) ServiceRestart

func (adm *AdminClient) ServiceRestart(ctx context.Context) error

ServiceRestart - restarts the MinIO cluster

func (*AdminClient) ServiceStop

func (adm *AdminClient) ServiceStop(ctx context.Context) error

ServiceStop - stops the MinIO cluster

func (AdminClient) ServiceTrace

func (adm AdminClient) ServiceTrace(ctx context.Context, opts ServiceTraceOpts) <-chan ServiceTraceInfo

ServiceTrace - listen on http trace notifications.

func (*AdminClient) ServiceUnfreeze

func (adm *AdminClient) ServiceUnfreeze(ctx context.Context) error

ServiceUnfreeze - un-freezes all incoming S3 API calls on MinIO cluster

func (*AdminClient) SetAppInfo

func (adm *AdminClient) SetAppInfo(appName string, appVersion string)

SetAppInfo - add application details to user agent.

func (*AdminClient) SetBucketQuota

func (adm *AdminClient) SetBucketQuota(ctx context.Context, bucket string, quota *BucketQuota) error

SetBucketQuota - sets a bucket's quota, if quota is set to '0' quota is disabled.

func (*AdminClient) SetConfig

func (adm *AdminClient) SetConfig(ctx context.Context, config io.Reader) (err error)

SetConfig - set config supplied as config.json for the setup.

func (*AdminClient) SetConfigKV

func (adm *AdminClient) SetConfigKV(ctx context.Context, kv string) (restart bool, err error)

SetConfigKV - set key value config to server.

func (*AdminClient) SetCustomTransport

func (adm *AdminClient) SetCustomTransport(customHTTPTransport http.RoundTripper)

SetCustomTransport - set new custom transport.

func (*AdminClient) SetGroupStatus

func (adm *AdminClient) SetGroupStatus(ctx context.Context, group string, status GroupStatus) error

SetGroupStatus - sets the status of a group.

func (*AdminClient) SetIDPConfig

func (adm *AdminClient) SetIDPConfig(ctx context.Context, cfgType, cfgName, cfgData string) (restart bool, err error)

SetIDPConfig - set idp config to server.

func (*AdminClient) SetPolicy

func (adm *AdminClient) SetPolicy(ctx context.Context, policyName, entityName string, isGroup bool) error

SetPolicy - sets the policy for a user or a group.

func (*AdminClient) SetRemoteTarget

func (adm *AdminClient) SetRemoteTarget(ctx context.Context, bucket string, target *BucketTarget) (string, error)

SetRemoteTarget sets up a remote target for this bucket

func (*AdminClient) SetUser

func (adm *AdminClient) SetUser(ctx context.Context, accessKey, secretKey string, status AccountStatus) error

SetUser - update user secret key or account status.

func (*AdminClient) SetUserStatus

func (adm *AdminClient) SetUserStatus(ctx context.Context, accessKey string, status AccountStatus) error

SetUserStatus - adds a status for a user.

func (*AdminClient) SiteReplicationAdd

func (adm *AdminClient) SiteReplicationAdd(ctx context.Context, sites []PeerSite) (ReplicateAddStatus, error)

SiteReplicationAdd - sends the SR add API call.

func (*AdminClient) SiteReplicationEdit

func (adm *AdminClient) SiteReplicationEdit(ctx context.Context, site PeerInfo) (ReplicateEditStatus, error)

SiteReplicationEdit - sends the SR edit API call.

func (*AdminClient) SiteReplicationInfo

func (adm *AdminClient) SiteReplicationInfo(ctx context.Context) (info SiteReplicationInfo, err error)

SiteReplicationInfo - returns cluster replication information.

func (*AdminClient) SiteReplicationRemove

func (adm *AdminClient) SiteReplicationRemove(ctx context.Context, removeReq SRRemoveReq) (st ReplicateRemoveStatus, err error)

SiteReplicationRemove - unlinks a site from site replication

func (*AdminClient) Speedtest

func (adm *AdminClient) Speedtest(ctx context.Context, opts SpeedtestOpts) (chan SpeedTestResult, error)

Speedtest - perform speedtest on the MinIO servers

func (*AdminClient) StartProfiling

func (adm *AdminClient) StartProfiling(ctx context.Context, profiler ProfilerType) ([]StartProfilingResult, error)

StartProfiling makes an admin call to remotely start profiling on a standalone server or the whole cluster in case of a distributed setup. Deprecated: use Profile API instead

func (*AdminClient) StatusPool

func (adm *AdminClient) StatusPool(ctx context.Context, pool string) (PoolStatus, error)

StatusPool return current status about pool, reports any draining activity in progress and elapsed time.

func (*AdminClient) StorageInfo

func (adm *AdminClient) StorageInfo(ctx context.Context) (StorageInfo, error)

StorageInfo - Connect to a minio server and call Storage Info Management API to fetch server's information represented by StorageInfo structure

func (*AdminClient) TierStats

func (adm *AdminClient) TierStats(ctx context.Context) ([]TierInfo, error)

TierStats returns per-tier stats of all configured tiers (incl. internal hot-tier)

func (*AdminClient) TopLocks

func (adm *AdminClient) TopLocks(ctx context.Context) (LockEntries, error)

TopLocks - returns top '10' oldest locks currently active on the server.

func (*AdminClient) TopLocksWithOpts

func (adm *AdminClient) TopLocksWithOpts(ctx context.Context, opts TopLockOpts) (LockEntries, error)

TopLocksWithOpts - returns the count number of oldest locks currently active on the server. additionally we can also enable `stale` to get stale locks currently present on server.

func (*AdminClient) TraceOff

func (adm *AdminClient) TraceOff()

TraceOff - disable HTTP tracing.

func (*AdminClient) TraceOn

func (adm *AdminClient) TraceOn(outputStream io.Writer)

TraceOn - enable HTTP tracing.

func (*AdminClient) UpdateGroupMembers

func (adm *AdminClient) UpdateGroupMembers(ctx context.Context, g GroupAddRemove) error

UpdateGroupMembers - adds/removes users to/from a group. Server creates the group as needed. Group is removed if remove request is made on empty group.

func (*AdminClient) UpdateRemoteTarget

func (adm *AdminClient) UpdateRemoteTarget(ctx context.Context, target *BucketTarget, ops ...TargetUpdateType) (string, error)

UpdateRemoteTarget updates credentials for a remote bucket target

func (*AdminClient) UpdateServiceAccount

func (adm *AdminClient) UpdateServiceAccount(ctx context.Context, accessKey string, opts UpdateServiceAccountReq) error

UpdateServiceAccount - edit an existing service account

func (*AdminClient) VerifyTier

func (adm *AdminClient) VerifyTier(ctx context.Context, tierName string) error

VerifyTier verifies tierName's remote tier config

type AliveOpts

type AliveOpts struct {
	Readiness bool // send request to /minio/health/ready
}

AliveOpts customizing liveness check.

type AliveResult

type AliveResult struct {
	Endpoint       *url.URL      `json:"endpoint"`
	ResponseTime   time.Duration `json:"responseTime"`
	DNSResolveTime time.Duration `json:"dnsResolveTime"`
	Online         bool          `json:"online"` // captures x-minio-server-status
	Error          error         `json:"error"`
}

AliveResult returns the time spent getting a response back from the server on /minio/health/live endpoint

type AnonymousClient

type AnonymousClient struct {
	// contains filtered or unexported fields
}

AnonymousClient implements an anonymous http client for MinIO

func NewAnonymousClient

func NewAnonymousClient(endpoint string, secure bool) (*AnonymousClient, error)

NewAnonymousClient can be used for anonymous APIs without credentials set

func NewAnonymousClientNoEndpoint

func NewAnonymousClientNoEndpoint() (*AnonymousClient, error)

func (*AnonymousClient) Alive

func (an *AnonymousClient) Alive(ctx context.Context, opts AliveOpts, servers ...ServerProperties) (resultsCh chan AliveResult)

Alive will hit `/minio/health/live` to check if server is reachable, optionally returns the amount of time spent getting a response back from the server.

func (*AnonymousClient) Healthy

func (an *AnonymousClient) Healthy(ctx context.Context, opts HealthOpts) (result HealthResult, err error)

Healthy will hit `/minio/health/cluster` and `/minio/health/cluster/ready` anonymous APIs to check the cluster health

func (*AnonymousClient) SetCustomTransport

func (an *AnonymousClient) SetCustomTransport(customHTTPTransport http.RoundTripper)

SetCustomTransport - set new custom transport.

func (*AnonymousClient) TraceOn

func (an *AnonymousClient) TraceOn(outputStream io.Writer)

TraceOn - enable HTTP tracing.

type Audit

type Audit map[string]Status

Audit contains audit logger status

type AzureOptions

type AzureOptions func(*TierAzure) error

AzureOptions supports NewTierAzure to take variadic options

type BackendDisks

type BackendDisks map[string]int

BackendDisks - represents the map of endpoint-disks.

func (BackendDisks) Merge

func (d1 BackendDisks) Merge(d2 BackendDisks) BackendDisks

Merge - Reduces two endpoint-disk maps.

func (BackendDisks) Sum

func (d1 BackendDisks) Sum() (sum int)

Sum - Return the sum of the disks in the endpoint-disk map.

type BackendInfo

type BackendInfo struct {
	// Represents various backend types, currently on FS, Erasure and Gateway
	Type BackendType

	// Following fields are only meaningful if BackendType is Gateway.
	GatewayOnline bool

	// Following fields are only meaningful if BackendType is Erasure.
	OnlineDisks  BackendDisks // Online disks during server startup.
	OfflineDisks BackendDisks // Offline disks during server startup.

	// Following fields are only meaningful if BackendType is Erasure.
	StandardSCData   []int // Data disks for currently configured Standard storage class.
	StandardSCParity int   // Parity disks for currently configured Standard storage class.
	RRSCData         []int // Data disks for currently configured Reduced Redundancy storage class.
	RRSCParity       int   // Parity disks for currently configured Reduced Redundancy storage class.

	// Adds number of erasure sets and drives per set.
	TotalSets    []int // Each index value corresponds to per pool
	DrivesPerSet []int // Each index value corresponds to per pool
}

BackendInfo - contains info of the underlying backend

type BackendType

type BackendType int

BackendType - represents different backend types.

const (
	Unknown BackendType = iota
	// Filesystem backend.
	FS
	// Multi disk Erasure (single, distributed) backend.
	Erasure
	// Gateway to other storage
	Gateway
)

Enum for different backend types.

type BandwidthDetails

type BandwidthDetails struct {
	LimitInBytesPerSecond            int64   `json:"limitInBits"`
	CurrentBandwidthInBytesPerSecond float64 `json:"currentBandwidth"`
}

BandwidthDetails for the measured bandwidth

type BgHealState

type BgHealState struct {
	// List of offline endpoints with no background heal state info
	OfflineEndpoints []string `json:"offline_nodes"`
	// Total items scanned by the continuous background healing
	ScannedItemsCount int64
	// Disks currently in heal states
	HealDisks []string
	// SetStatus contains information for each set.
	Sets []SetStatus `json:"sets"`
	// Endpoint -> MRF Status
	MRF map[string]MRFStatus `json:"mrf"`
	// Parity per storage class
	SCParity map[string]int `json:"sc_parity"`
}

BgHealState represents the status of the background heal

func (*BgHealState) Merge

func (b *BgHealState) Merge(others ...BgHealState)

Merge others into b.

type BktOp

type BktOp string

BktOp represents the bucket operation being requested.

const (
	// make bucket and enable versioning
	MakeWithVersioningBktOp BktOp = "make-with-versioning"
	// add replication configuration
	ConfigureReplBktOp BktOp = "configure-replication"
	// delete bucket (forceDelete = off)
	DeleteBucketBktOp BktOp = "delete-bucket"
	// delete bucket (forceDelete = on)
	ForceDeleteBucketBktOp BktOp = "force-delete-bucket"
	// purge bucket
	PurgeDeletedBucketOp BktOp = "purge-deleted-bucket"
)

BktOp value constants.

type BucketAccessInfo

type BucketAccessInfo struct {
	Name                 string            `json:"name"`
	Size                 uint64            `json:"size"`
	Objects              uint64            `json:"objects"`
	ObjectSizesHistogram map[string]uint64 `json:"objectHistogram"`
	Details              *BucketDetails    `json:"details"`
	PrefixUsage          map[string]uint64 `json:"prefixUsage"`
	Created              time.Time         `json:"created"`
	Access               AccountAccess     `json:"access"`
}

BucketAccessInfo represents bucket usage of a bucket, and its relevant access type for an account

type BucketBandwidthReport

type BucketBandwidthReport struct {
	BucketStats map[string]BandwidthDetails `json:"bucketStats,omitempty"`
}

BucketBandwidthReport captures the details for all buckets.

type BucketDetails

type BucketDetails struct {
	Versioning          bool         `json:"versioning"`
	VersioningSuspended bool         `json:"versioningSuspended"`
	Locking             bool         `json:"locking"`
	Replication         bool         `json:"replication"`
	Tagging             *tags.Tags   `json:"tags"`
	Quota               *BucketQuota `json:"quota"`
}

BucketDetails provides information about features currently turned-on per bucket.

type BucketMetaImportErrs

type BucketMetaImportErrs struct {
	Buckets map[string]BucketStatus `json:"buckets,omitempty"`
}

BucketMetaImportErrs reports on bucket metadata import status.

type BucketQuota

type BucketQuota struct {
	Quota uint64    `json:"quota"`
	Type  QuotaType `json:"quotatype,omitempty"`
}

BucketQuota holds bucket quota restrictions

func (BucketQuota) IsValid

func (q BucketQuota) IsValid() bool

IsValid returns false if quota is invalid empty quota when Quota == 0 is always true.

type BucketStatus

type BucketStatus struct {
	ObjectLock   MetaStatus `json:"olock"`
	Versioning   MetaStatus `json:"versioning"`
	Policy       MetaStatus `json:"policy"`
	Tagging      MetaStatus `json:"tagging"`
	SSEConfig    MetaStatus `json:"sse"`
	Lifecycle    MetaStatus `json:"lifecycle"`
	Notification MetaStatus `json:"notification"`
	Quota        MetaStatus `json:"quota"`
	Err          string     `json:"error,omitempty"`
}

BucketStatus reflects status of bucket metadata import

type BucketTarget

type BucketTarget struct {
	SourceBucket        string        `json:"sourcebucket"`
	Endpoint            string        `json:"endpoint"`
	Credentials         *Credentials  `json:"credentials"`
	TargetBucket        string        `json:"targetbucket"`
	Secure              bool          `json:"secure"`
	Path                string        `json:"path,omitempty"`
	API                 string        `json:"api,omitempty"`
	Arn                 string        `json:"arn,omitempty"`
	Type                ServiceType   `json:"type"`
	Region              string        `json:"omitempty"`
	BandwidthLimit      int64         `json:"bandwidthlimit,omitempty"`
	ReplicationSync     bool          `json:"replicationSync"`
	StorageClass        string        `json:"storageclass,omitempty"`
	HealthCheckDuration time.Duration `json:"healthCheckDuration,omitempty"`
	DisableProxy        bool          `json:"disableProxy"`
	ResetBeforeDate     time.Time     `json:"resetBeforeDate,omitempty"`
	ResetID             string        `json:"resetID,omitempty"`
}

BucketTarget represents the target bucket and site association.

func (*BucketTarget) Clone

func (t *BucketTarget) Clone() BucketTarget

Clone returns shallow clone of BucketTarget without secret key in credentials

func (BucketTarget) Empty

func (t BucketTarget) Empty() bool

Empty returns true if struct is empty.

func (*BucketTarget) String

func (t *BucketTarget) String() string

func (BucketTarget) URL

func (t BucketTarget) URL() *url.URL

URL returns target url

type BucketTargets

type BucketTargets struct {
	Targets []BucketTarget
}

BucketTargets represents a slice of bucket targets by type and endpoint

func (BucketTargets) Empty

func (t BucketTargets) Empty() bool

Empty returns true if struct is empty.

type BucketUsageInfo

type BucketUsageInfo struct {
	Size                    uint64 `json:"size"`
	ReplicationPendingSize  uint64 `json:"objectsPendingReplicationTotalSize"`
	ReplicationFailedSize   uint64 `json:"objectsFailedReplicationTotalSize"`
	ReplicatedSize          uint64 `json:"objectsReplicatedTotalSize"`
	ReplicaSize             uint64 `json:"objectReplicaTotalSize"`
	ReplicationPendingCount uint64 `json:"objectsPendingReplicationCount"`
	ReplicationFailedCount  uint64 `json:"objectsFailedReplicationCount"`

	VersionsCount        uint64            `json:"versionsCount"`
	ObjectsCount         uint64            `json:"objectsCount"`
	ObjectSizesHistogram map[string]uint64 `json:"objectsSizesHistogram"`
}

BucketUsageInfo - bucket usage info provides - total size of the bucket - total objects in a bucket - object size histogram per bucket

type Buckets

type Buckets struct {
	Count uint64 `json:"count"`
	Error string `json:"error,omitempty"`
}

Buckets contains the number of buckets

type CPU

type CPU struct {
	VendorID   string   `json:"vendor_id"`
	Family     string   `json:"family"`
	Model      string   `json:"model"`
	Stepping   int32    `json:"stepping"`
	PhysicalID string   `json:"physical_id"`
	ModelName  string   `json:"model_name"`
	Mhz        float64  `json:"mhz"`
	CacheSize  int32    `json:"cache_size"`
	Flags      []string `json:"flags"`
	Microcode  string   `json:"microcode"`
	Cores      int      `json:"cores"` // computed
}

CPU contains system's CPU information.

type CPUs

type CPUs struct {
	NodeCommon

	CPUs          []CPU `json:"cpus,omitempty"`
	IsFreqGovPerf *bool `json:"is_freq_gov_perf,omitempty"`
}

CPUs contains all CPU information of a node.

func GetCPUs

func GetCPUs(ctx context.Context, addr string) CPUs

GetCPUs returns system's all CPU information.

type ClusterInfo

type ClusterInfo struct {
	MinioVersion    string `json:"minio_version"`
	NoOfServerPools int    `json:"no_of_server_pools"`
	NoOfServers     int    `json:"no_of_servers"`
	NoOfDrives      int    `json:"no_of_drives"`
	NoOfBuckets     uint64 `json:"no_of_buckets"`
	NoOfObjects     uint64 `json:"no_of_objects"`
	TotalDriveSpace uint64 `json:"total_drive_space"`
	UsedDriveSpace  uint64 `json:"used_drive_space"`
}

ClusterInfo - The "info" sub-node of the cluster registration information struct Intended to be extensible i.e. more fields will be added as and when required

type ClusterRegistrationInfo

type ClusterRegistrationInfo struct {
	DeploymentID string      `json:"deployment_id"`
	ClusterName  string      `json:"cluster_name"`
	UsedCapacity uint64      `json:"used_capacity"`
	Info         ClusterInfo `json:"info"`
}

ClusterRegistrationInfo - Information stored in the cluster registration token

type ClusterRegistrationReq

type ClusterRegistrationReq struct {
	Token string `json:"token"`
}

ClusterRegistrationReq - JSON payload of the subnet api for cluster registration Contains a registration token created by base64 encoding of the registration info

type ConfigHistoryEntry

type ConfigHistoryEntry struct {
	RestoreID  string    `json:"restoreId"`
	CreateTime time.Time `json:"createTime"`
	Data       string    `json:"data"`
}

ConfigHistoryEntry - captures config set history with a unique restore ID and createTime

func (ConfigHistoryEntry) CreateTimeFormatted

func (ch ConfigHistoryEntry) CreateTimeFormatted() string

CreateTimeFormatted is used to print formatted time for CreateTime.

type ConfigKV

type ConfigKV struct {
	Key         string       `json:"key"`
	Value       string       `json:"value"`
	EnvOverride *EnvOverride `json:"envOverride,omitempty"`
}

ConfigKV represents a configuration key and value, along with any environment override if present.

type Credentials

type Credentials struct {
	AccessKey    string    `xml:"AccessKeyId" json:"accessKey,omitempty"`
	SecretKey    string    `xml:"SecretAccessKey" json:"secretKey,omitempty"`
	SessionToken string    `xml:"SessionToken" json:"sessionToken,omitempty"`
	Expiration   time.Time `xml:"Expiration" json:"expiration,omitempty"`
}

Credentials holds access and secret keys.

type DailyTierStats

type DailyTierStats struct {
	Bins      [24]TierStats
	UpdatedAt time.Time
}

type DataUsageInfo

type DataUsageInfo struct {
	// LastUpdate is the timestamp of when the data usage info was last updated.
	// This does not indicate a full scan.
	LastUpdate time.Time `json:"lastUpdate"`

	// Objects total count across all buckets
	ObjectsTotalCount uint64 `json:"objectsCount"`

	// Objects total size across all buckets
	ObjectsTotalSize uint64 `json:"objectsTotalSize"`

	// Total Size for objects that have not yet been replicated
	ReplicationPendingSize uint64 `json:"objectsPendingReplicationTotalSize"`

	// Total size for objects that have witness one or more failures and will be retried
	ReplicationFailedSize uint64 `json:"objectsFailedReplicationTotalSize"`

	// Total size for objects that have been replicated to destination
	ReplicatedSize uint64 `json:"objectsReplicatedTotalSize"`

	// Total size for objects that are replicas
	ReplicaSize uint64 `json:"objectsReplicaTotalSize"`

	// Total number of objects pending replication
	ReplicationPendingCount uint64 `json:"objectsPendingReplicationCount"`

	// Total number of objects that failed replication
	ReplicationFailedCount uint64 `json:"objectsFailedReplicationCount"`

	// Total number of buckets in this cluster
	BucketsCount uint64 `json:"bucketsCount"`

	// Buckets usage info provides following information across all buckets
	// - total size of the bucket
	// - total objects in a bucket
	// - object size histogram per bucket
	BucketsUsage map[string]BucketUsageInfo `json:"bucketsUsageInfo"`

	// TierStats holds per-tier stats like bytes tiered, etc.
	TierStats map[string]TierStats `json:"tierStats"`

	// Deprecated kept here for backward compatibility reasons.
	BucketSizes map[string]uint64 `json:"bucketsSizes"`
}

DataUsageInfo represents data usage stats of the underlying Object API

type DiffInfo

type DiffInfo struct {
	Object                  string                 `json:"object"`
	VersionID               string                 `json:"versionId"`
	Targets                 map[string]TgtDiffInfo `json:"targets,omitempty"`
	Err                     error                  `json:"error,omitempty"`
	ReplicationStatus       string                 `json:"rStatus,omitempty"` // overall replication status
	DeleteReplicationStatus string                 `json:"dStatus,omitempty"` // overall replication status of version delete
	ReplicationTimestamp    time.Time              `json:"replTimestamp,omitempty"`
	LastModified            time.Time              `json:"lastModified,omitempty"`
	IsDeleteMarker          bool                   `json:"deletemarker"`
}

DiffInfo represents relevant replication status and last attempt to replicate for the replication targets configured for the bucket

type Disk

type Disk struct {
	Endpoint        string       `json:"endpoint,omitempty"`
	RootDisk        bool         `json:"rootDisk,omitempty"`
	DrivePath       string       `json:"path,omitempty"`
	Healing         bool         `json:"healing,omitempty"`
	Scanning        bool         `json:"scanning,omitempty"`
	State           string       `json:"state,omitempty"`
	UUID            string       `json:"uuid,omitempty"`
	Major           uint32       `json:"major"`
	Minor           uint32       `json:"minor"`
	Model           string       `json:"model,omitempty"`
	TotalSpace      uint64       `json:"totalspace,omitempty"`
	UsedSpace       uint64       `json:"usedspace,omitempty"`
	AvailableSpace  uint64       `json:"availspace,omitempty"`
	ReadThroughput  float64      `json:"readthroughput,omitempty"`
	WriteThroughPut float64      `json:"writethroughput,omitempty"`
	ReadLatency     float64      `json:"readlatency,omitempty"`
	WriteLatency    float64      `json:"writelatency,omitempty"`
	Utilization     float64      `json:"utilization,omitempty"`
	Metrics         *DiskMetrics `json:"metrics,omitempty"`
	HealInfo        *HealingDisk `json:"heal_info,omitempty"`
	FreeInodes      uint64       `json:"free_inodes,omitempty"`

	// Indexes, will be -1 until assigned a set.
	PoolIndex int `json:"pool_index"`
	SetIndex  int `json:"set_index"`
	DiskIndex int `json:"disk_index"`
}

Disk holds Disk information

type DiskIOStats

type DiskIOStats struct {
	ReadIOs        uint64 `json:"read_ios"`
	ReadMerges     uint64 `json:"read_merges"`
	ReadSectors    uint64 `json:"read_sectors"`
	ReadTicks      uint64 `json:"read_ticks"`
	WriteIOs       uint64 `json:"write_ios"`
	WriteMerges    uint64 `json:"write_merges"`
	WriteSectors   uint64 `json:"wrte_sectors"`
	WriteTicks     uint64 `json:"write_ticks"`
	CurrentIOs     uint64 `json:"current_ios"`
	TotalTicks     uint64 `json:"total_ticks"`
	ReqTicks       uint64 `json:"req_ticks"`
	DiscardIOs     uint64 `json:"discard_ios"`
	DiscardMerges  uint64 `json:"discard_merges"`
	DiscardSectors uint64 `json:"discard_secotrs"`
	DiscardTicks   uint64 `json:"discard_ticks"`
	FlushIOs       uint64 `json:"flush_ios"`
	FlushTicks     uint64 `json:"flush_ticks"`
}

DiskIOStats contains IO stats of a single drive

type DiskLatency

type DiskLatency struct {
	Avg          float64 `json:"avg_secs,omitempty"`
	Percentile50 float64 `json:"percentile50_secs,omitempty"`
	Percentile90 float64 `json:"percentile90_secs,omitempty"`
	Percentile99 float64 `json:"percentile99_secs,omitempty"`
	Min          float64 `json:"min_secs,omitempty"`
	Max          float64 `json:"max_secs,omitempty"`
}

DiskLatency holds latency information for write operations to the drive

type DiskMetric

type DiskMetric struct {
	// Time these metrics were collected
	CollectedAt time.Time `json:"collected"`

	// Number of disks
	NDisks int `json:"n_disks"`

	// Offline disks
	Offline int `json:"offline,omitempty"`

	// Healing disks
	Healing int `json:"healing,omitempty"`

	// Number of accumulated operations by type since server restart.
	LifeTimeOps map[string]uint64 `json:"life_time_ops,omitempty"`

	// Last minute statistics.
	LastMinute struct {
		Operations map[string]TimedAction `json:"operations,omitempty"`
	} `json:"last_minute"`

	IOStats DiskIOStats `json:"iostats,omitempty"`
}

DiskMetric contains metrics for one or more disks.

func (*DiskMetric) Merge

func (d *DiskMetric) Merge(other *DiskMetric)

Merge other into 's'.

type DiskMetrics

type DiskMetrics struct {
	LastMinute map[string]TimedAction `json:"lastMinute,omitempty"`
	APICalls   map[string]uint64      `json:"apiCalls,omitempty"`

	// Deprecated: Use LastMinute instead. Not populated from servers after July 2022.
	APILatencies map[string]interface{} `json:"apiLatencies,omitempty"`
}

DiskMetrics has the information about XL Storage APIs the number of calls of each API and the moving average of the duration, in nanosecond, of each API.

type DiskThroughput

type DiskThroughput struct {
	Avg          float64 `json:"avg_bytes_per_sec,omitempty"`
	Percentile50 float64 `json:"percentile50_bytes_per_sec,omitempty"`
	Percentile90 float64 `json:"percentile90_bytes_per_sec,omitempty"`
	Percentile99 float64 `json:"percentile99_bytes_per_sec,omitempty"`
	Min          float64 `json:"min_bytes_per_sec,omitempty"`
	Max          float64 `json:"max_bytes_per_sec,omitempty"`
}

DiskThroughput holds throughput information for write operations to the drive

type DrivePerf

type DrivePerf struct {
	Path            string `json:"path"`
	ReadThroughput  uint64 `json:"readThroughput"`
	WriteThroughput uint64 `json:"writeThroughput"`

	Error string `json:"error,omitempty"`
}

DrivePerf - result of drive speed test on 1 drive mounted at path

type DrivePerfInfo

type DrivePerfInfo struct {
	Error string `json:"error,omitempty"`

	Path       string     `json:"path"`
	Latency    Latency    `json:"latency,omitempty"`
	Throughput Throughput `json:"throughput,omitempty"`
}

DrivePerfInfo contains disk drive's performance information.

type DrivePerfInfoV0

type DrivePerfInfoV0 struct {
	Path       string         `json:"endpoint"`
	Latency    DiskLatency    `json:"latency,omitempty"`
	Throughput DiskThroughput `json:"throughput,omitempty"`
	Error      string         `json:"error,omitempty"`
}

DrivePerfInfoV0 - Stats about a single drive in a MinIO node

type DrivePerfInfos

type DrivePerfInfos struct {
	NodeCommon

	SerialPerf   []DrivePerfInfo `json:"serial_perf,omitempty"`
	ParallelPerf []DrivePerfInfo `json:"parallel_perf,omitempty"`
}

DrivePerfInfos contains all disk drive's performance information of a node.

type DriveSpeedTestOpts

type DriveSpeedTestOpts struct {
	Serial    bool   // Run speed tests one drive at a time
	BlockSize uint64 // BlockSize for read/write (default 4MiB)
	FileSize  uint64 // Total fileSize to write and read (default 1GiB)
}

DriveSpeedTestOpts provide configurable options for drive speedtest

type DriveSpeedTestResult

type DriveSpeedTestResult struct {
	Version   string      `json:"version"`
	Endpoint  string      `json:"endpoint"`
	DrivePerf []DrivePerf `json:"drivePerf,omitempty"`

	Error string `json:"string,omitempty"`
}

DriveSpeedTestResult - result of the drive speed test

type EnvOverride

type EnvOverride struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

EnvOverride contains the name of the environment variable and its value.

type ErasureBackend

type ErasureBackend struct {
	Type         backendType `json:"backendType,omitempty"`
	OnlineDisks  int         `json:"onlineDisks,omitempty"`
	OfflineDisks int         `json:"offlineDisks,omitempty"`
	// Parity disks for currently configured Standard storage class.
	StandardSCParity int `json:"standardSCParity,omitempty"`
	// Parity disks for currently configured Reduced Redundancy storage class.
	RRSCParity int `json:"rrSCParity,omitempty"`
}

ErasureBackend contains specific erasure storage information

type ErrorResponse

type ErrorResponse struct {
	XMLName    xml.Name `xml:"Error" json:"-"`
	Code       string
	Message    string
	BucketName string
	Key        string
	RequestID  string `xml:"RequestId"`
	HostID     string `xml:"HostId"`

	// Region where the bucket is located. This header is returned
	// only in HEAD bucket and ListObjects response.
	Region string
}

ErrorResponse - Is the typed error returned by all API operations.

func ToErrorResponse

func ToErrorResponse(err error) ErrorResponse

ToErrorResponse - Returns parsed ErrorResponse struct from body and http headers.

For example:

import admin "github.com/87ZGitHub/madmin-go"
...
...
ss, err := adm.ServiceStatus(...)
if err != nil {
   resp := admin.ToErrorResponse(err)
}
...

func (ErrorResponse) Error

func (e ErrorResponse) Error() string

Error - Returns HTTP error string

type FSBackend

type FSBackend struct {
	Type backendType `json:"backendType,omitempty"`
}

FSBackend contains specific FS storage information

type GCSOptions

type GCSOptions func(*TierGCS) error

GCSOptions supports NewTierGCS to take variadic options

type GCStats

type GCStats struct {
	LastGC     time.Time       `json:"last_gc"`     // time of last collection
	NumGC      int64           `json:"num_gc"`      // number of garbage collections
	PauseTotal time.Duration   `json:"pause_total"` // total pause for all collections
	Pause      []time.Duration `json:"pause"`       // pause history, most recent first
	PauseEnd   []time.Time     `json:"pause_end"`   // pause end times history, most recent first
}

GCStats collect information about recent garbage collections.

type GroupAddRemove

type GroupAddRemove struct {
	Group    string      `json:"group"`
	Members  []string    `json:"members"`
	Status   GroupStatus `json:"groupStatus"`
	IsRemove bool        `json:"isRemove"`
}

GroupAddRemove is type for adding/removing members to/from a group.

type GroupDesc

type GroupDesc struct {
	Name      string    `json:"name"`
	Status    string    `json:"status"`
	Members   []string  `json:"members"`
	Policy    string    `json:"policy"`
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

GroupDesc is a type that holds group info along with the policy attached to it.

type GroupStatus

type GroupStatus string

GroupStatus - group status.

const (
	GroupEnabled  GroupStatus = "enabled"
	GroupDisabled GroupStatus = "disabled"
)

GroupStatus values.

type HealDriveInfo

type HealDriveInfo struct {
	UUID     string `json:"uuid"`
	Endpoint string `json:"endpoint"`
	State    string `json:"state"`
}

HealDriveInfo - struct for an individual drive info item.

type HealItemType

type HealItemType string

HealItemType - specify the type of heal operation in a healing result

type HealOpts

type HealOpts struct {
	Recursive bool         `json:"recursive"`
	DryRun    bool         `json:"dryRun"`
	Remove    bool         `json:"remove"`
	Recreate  bool         `json:"recreate"` // Rewrite all resources specified at the bucket or prefix.
	ScanMode  HealScanMode `json:"scanMode"`
	NoLock    bool         `json:"nolock"`
}

HealOpts - collection of options for a heal sequence

func (HealOpts) Equal

func (o HealOpts) Equal(no HealOpts) bool

Equal returns true if no is same as o.

type HealResultItem

type HealResultItem struct {
	ResultIndex  int64        `json:"resultId"`
	Type         HealItemType `json:"type"`
	Bucket       string       `json:"bucket"`
	Object       string       `json:"object"`
	VersionID    string       `json:"versionId"`
	Detail       string       `json:"detail"`
	ParityBlocks int          `json:"parityBlocks,omitempty"`
	DataBlocks   int          `json:"dataBlocks,omitempty"`
	DiskCount    int          `json:"diskCount"`
	SetCount     int          `json:"setCount"`
	// below slices are from drive info.
	Before struct {
		Drives []HealDriveInfo `json:"drives"`
	} `json:"before"`
	After struct {
		Drives []HealDriveInfo `json:"drives"`
	} `json:"after"`
	ObjectSize int64 `json:"objectSize"`
}

HealResultItem - struct for an individual heal result item

func (*HealResultItem) GetCorruptedCounts

func (hri *HealResultItem) GetCorruptedCounts() (b, a int)

GetCorruptedCounts - returns the number of corrupted disks before and after heal

func (*HealResultItem) GetMissingCounts

func (hri *HealResultItem) GetMissingCounts() (b, a int)

GetMissingCounts - returns the number of missing disks before and after heal

func (*HealResultItem) GetOfflineCounts

func (hri *HealResultItem) GetOfflineCounts() (b, a int)

GetOfflineCounts - returns the number of offline disks before and after heal

func (*HealResultItem) GetOnlineCounts

func (hri *HealResultItem) GetOnlineCounts() (b, a int)

GetOnlineCounts - returns the number of online disks before and after heal

type HealScanMode

type HealScanMode int

HealScanMode represents the type of healing scan

const (
	// HealUnknownScan default is unknown
	HealUnknownScan HealScanMode = iota

	// HealNormalScan checks if parts are present and not outdated
	HealNormalScan

	// HealDeepScan checks for parts bitrot checksums
	HealDeepScan
)

type HealStartSuccess

type HealStartSuccess struct {
	ClientToken   string    `json:"clientToken"`
	ClientAddress string    `json:"clientAddress"`
	StartTime     time.Time `json:"startTime"`
}

HealStartSuccess - holds information about a successfully started heal operation

type HealStopSuccess

type HealStopSuccess HealStartSuccess

HealStopSuccess - holds information about a successfully stopped heal operation.

type HealTaskStatus

type HealTaskStatus struct {
	Summary       string    `json:"summary"`
	FailureDetail string    `json:"detail"`
	StartTime     time.Time `json:"startTime"`
	HealSettings  HealOpts  `json:"settings"`

	Items []HealResultItem `json:"items,omitempty"`
}

HealTaskStatus - status struct for a heal task

type HealingDisk

type HealingDisk struct {
	ID         string    `json:"id"`
	PoolIndex  int       `json:"pool_index"`
	SetIndex   int       `json:"set_index"`
	DiskIndex  int       `json:"disk_index"`
	Endpoint   string    `json:"endpoint"`
	Path       string    `json:"path"`
	Started    time.Time `json:"started"`
	LastUpdate time.Time `json:"last_update"`

	ObjectsTotalCount uint64 `json:"objects_total_count"`
	ObjectsTotalSize  uint64 `json:"objects_total_size"`

	ItemsHealed uint64 `json:"items_healed"`
	ItemsFailed uint64 `json:"items_failed"`
	BytesDone   uint64 `json:"bytes_done"`
	BytesFailed uint64 `json:"bytes_failed"`

	ObjectsHealed uint64 `json:"objects_healed"` // Deprecated July 2021
	ObjectsFailed uint64 `json:"objects_failed"` // Deprecated July 2021

	// Last object scanned.
	Bucket string `json:"current_bucket"`
	Object string `json:"current_object"`

	// Filled on startup/restarts.
	QueuedBuckets []string `json:"queued_buckets"`

	// Filled during heal.
	HealedBuckets []string `json:"healed_buckets"`
}

HealingDisk contains information about

type HealthDataType

type HealthDataType string

HealthDataType - Typed Health data types

const (
	HealthDataTypePerfDrive   HealthDataType = "driveperf"
	HealthDataTypePerfNet     HealthDataType = "netperf"
	HealthDataTypePerfObj     HealthDataType = "objperf"
	HealthDataTypeMinioInfo   HealthDataType = "minioinfo"
	HealthDataTypeMinioConfig HealthDataType = "minioconfig"
	HealthDataTypeSysCPU      HealthDataType = "syscpu"
	HealthDataTypeSysDriveHw  HealthDataType = "sysdrivehw"
	HealthDataTypeSysDocker   HealthDataType = "sysdocker" // is this really needed?
	HealthDataTypeSysOsInfo   HealthDataType = "sysosinfo"
	HealthDataTypeSysLoad     HealthDataType = "sysload" // provides very little info. Making it TBD
	HealthDataTypeSysMem      HealthDataType = "sysmem"
	HealthDataTypeSysNet      HealthDataType = "sysnet"
	HealthDataTypeSysProcess  HealthDataType = "sysprocess"
	HealthDataTypeSysErrors   HealthDataType = "syserrors"
	HealthDataTypeSysServices HealthDataType = "sysservices"
	HealthDataTypeSysConfig   HealthDataType = "sysconfig"
)

HealthDataTypes

type HealthInfo

type HealthInfo struct {
	Version string `json:"version"`
	Error   string `json:"error,omitempty"`

	TimeStamp time.Time        `json:"timestamp,omitempty"`
	Sys       SysInfo          `json:"sys,omitempty"`
	Perf      SpeedTestResults `json:"perf,omitempty"`
	Minio     MinioHealthInfo  `json:"minio,omitempty"`
}

HealthInfo - MinIO cluster's health Info

func (HealthInfo) GetError

func (info HealthInfo) GetError() string

GetError - returns error from the cluster health info

func (HealthInfo) GetStatus

func (info HealthInfo) GetStatus() string

GetStatus - returns status of the cluster health info

func (HealthInfo) GetTimestamp

func (info HealthInfo) GetTimestamp() time.Time

GetTimestamp - returns timestamp from the cluster health info

func (HealthInfo) JSON

func (info HealthInfo) JSON() string

JSON returns this structure as JSON formatted string.

func (HealthInfo) String

func (info HealthInfo) String() string

type HealthInfoV0

type HealthInfoV0 struct {
	TimeStamp time.Time         `json:"timestamp,omitempty"`
	Error     string            `json:"error,omitempty"`
	Perf      PerfInfoV0        `json:"perf,omitempty"`
	Minio     MinioHealthInfoV0 `json:"minio,omitempty"`
	Sys       SysHealthInfo     `json:"sys,omitempty"`
}

HealthInfoV0 - MinIO cluster's health Info version 0

func (HealthInfoV0) JSON

func (info HealthInfoV0) JSON() string

JSON returns this structure as JSON formatted string.

func (HealthInfoV0) String

func (info HealthInfoV0) String() string

type HealthInfoV2

type HealthInfoV2 struct {
	Version string `json:"version"`
	Error   string `json:"error,omitempty"`

	TimeStamp time.Time       `json:"timestamp,omitempty"`
	Sys       SysInfo         `json:"sys,omitempty"`
	Perf      PerfInfo        `json:"perf,omitempty"`
	Minio     MinioHealthInfo `json:"minio,omitempty"`
}

HealthInfoV2 - MinIO cluster's health Info version 2

func (HealthInfoV2) GetError

func (info HealthInfoV2) GetError() string

GetError - returns error from the cluster health info v2

func (HealthInfoV2) GetStatus

func (info HealthInfoV2) GetStatus() string

GetStatus - returns status of the cluster health info v2

func (HealthInfoV2) GetTimestamp

func (info HealthInfoV2) GetTimestamp() time.Time

GetTimestamp - returns timestamp from the cluster health info v2

func (HealthInfoV2) JSON

func (info HealthInfoV2) JSON() string

JSON returns this structure as JSON formatted string.

func (HealthInfoV2) String

func (info HealthInfoV2) String() string

type HealthInfoVersionStruct

type HealthInfoVersionStruct struct {
	Version string `json:"version,omitempty"`
	Error   string `json:"error,omitempty"`
}

HealthInfoVersionStruct - struct for health info version

type HealthOpts

type HealthOpts struct {
	ClusterRead bool
	Maintenance bool
}

HealthOpts represents the input options for the health check

type HealthResult

type HealthResult struct {
	Healthy         bool
	MaintenanceMode bool
	WriteQuorum     int
	HealingDrives   int
}

HealthResult represents the cluster health result

type Help

type Help struct {
	SubSys          string  `json:"subSys"`
	Description     string  `json:"description"`
	MultipleTargets bool    `json:"multipleTargets"`
	KeysHelp        HelpKVS `json:"keysHelp"`
}

Help - return sub-system level help

func (Help) Keys

func (h Help) Keys() []string

Keys returns help keys

type HelpKV

type HelpKV struct {
	Key             string `json:"key"`
	Description     string `json:"description"`
	Optional        bool   `json:"optional"`
	Type            string `json:"type"`
	MultipleTargets bool   `json:"multipleTargets"`
}

HelpKV - implements help messages for keys with value as description of the keys.

type HelpKVS

type HelpKVS []HelpKV

HelpKVS - implement order of keys help messages.

type IDPCfgInfo

type IDPCfgInfo struct {
	Key   string `json:"key"`
	Value string `json:"value"`
	IsCfg bool   `json:"isCfg"`
	IsEnv bool   `json:"isEnv"` // relevant only when isCfg=true
}

IDPCfgInfo represents a single configuration or related parameter

type IDPConfig

type IDPConfig struct {
	Type string       `json:"type"`
	Name string       `json:"name,omitempty"`
	Info []IDPCfgInfo `json:"info"`
}

IDPConfig contains IDP configuration information returned by server.

type IDPListItem

type IDPListItem struct {
	Type    string `json:"type"`
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
	RoleARN string `json:"roleARN,omitempty"`
}

IDPListItem - represents an item in the List IDPs call.

type IDPSettings

type IDPSettings struct {
	LDAP   LDAPSettings
	OpenID OpenIDSettings
}

IDPSettings contains key IDentity Provider settings to validate that all peers have the same configuration.

type InfoMessage

type InfoMessage struct {
	Mode         string             `json:"mode,omitempty"`
	Domain       []string           `json:"domain,omitempty"`
	Region       string             `json:"region,omitempty"`
	SQSARN       []string           `json:"sqsARN,omitempty"`
	DeploymentID string             `json:"deploymentID,omitempty"`
	Buckets      Buckets            `json:"buckets,omitempty"`
	Objects      Objects            `json:"objects,omitempty"`
	Versions     Versions           `json:"versions,omitempty"`
	Usage        Usage              `json:"usage,omitempty"`
	Services     Services           `json:"services,omitempty"`
	Backend      interface{}        `json:"backend,omitempty"`
	Servers      []ServerProperties `json:"servers,omitempty"`
}

InfoMessage container to hold server admin related information.

func (InfoMessage) BackendType

func (info InfoMessage) BackendType() BackendType

func (InfoMessage) StandardParity

func (info InfoMessage) StandardParity() int

type InfoServiceAccountResp

type InfoServiceAccountResp struct {
	ParentUser    string `json:"parentUser"`
	AccountStatus string `json:"accountStatus"`
	ImpliedPolicy bool   `json:"impliedPolicy"`
	Policy        string `json:"policy"`
}

InfoServiceAccountResp is the response body of the info service account call

type InspectOptions

type InspectOptions struct {
	Volume, File string
}

InspectOptions provides options to Inspect.

type ItemState

type ItemState string

ItemState - represents the status of any item in offline,init,online state

type KMS

type KMS struct {
	Status  string `json:"status,omitempty"`
	Encrypt string `json:"encrypt,omitempty"`
	Decrypt string `json:"decrypt,omitempty"`
}

KMS contains KMS status information

type KMSKeyStatus

type KMSKeyStatus struct {
	KeyID         string `json:"key-id"`
	EncryptionErr string `json:"encryption-error,omitempty"` // An empty error == success
	DecryptionErr string `json:"decryption-error,omitempty"` // An empty error == success
}

KMSKeyStatus contains some status information about a KMS master key. The MinIO server tries to access the KMS and perform encryption and decryption operations. If the MinIO server can access the KMS and all master key operations succeed it returns a status containing only the master key ID but no error.

type KMSStatus

type KMSStatus struct {
	Name         string               `json:"name"`           // Name or type of the KMS
	DefaultKeyID string               `json:"default-key-id"` // The key ID used when no explicit key is specified
	Endpoints    map[string]ItemState `json:"endpoints"`      // List of KMS endpoints and their status (online/offline)
}

KMSStatus contains various informations about the KMS connected to a MinIO server - like the KMS endpoints and the default key ID.

type KVOptions

type KVOptions struct {
	Env bool
}

KVOptions takes specific inputs for KV functions

type KubernetesInfo

type KubernetesInfo struct {
	Major      string    `json:"major,omitempty"`
	Minor      string    `json:"minor,omitempty"`
	GitVersion string    `json:"gitVersion,omitempty"`
	GitCommit  string    `json:"gitCommit,omitempty"`
	BuildDate  time.Time `json:"buildDate,omitempty"`
	Platform   string    `json:"platform,omitempty"`
	Error      string    `json:"error,omitempty"`
}

KubernetesInfo - Information about the kubernetes platform

type LDAP

type LDAP struct {
	Status string `json:"status,omitempty"`
}

LDAP contains ldap status

type LDAPSettings

type LDAPSettings struct {
	IsLDAPEnabled          bool
	LDAPUserDNSearchBase   string
	LDAPUserDNSearchFilter string
	LDAPGroupSearchBase    string
	LDAPGroupSearchFilter  string
}

LDAPSettings contains LDAP configuration info of a cluster.

type Latency

type Latency struct {
	Avg          float64 `json:"avg"`
	Max          float64 `json:"max"`
	Min          float64 `json:"min"`
	Percentile50 float64 `json:"percentile_50"`
	Percentile90 float64 `json:"percentile_90"`
	Percentile99 float64 `json:"percentile_99"`
}

Latency contains write operation latency in seconds of a disk drive.

type ListServiceAccountsResp

type ListServiceAccountsResp struct {
	Accounts []string `json:"accounts"`
}

ListServiceAccountsResp is the response body of the list service accounts call

type LockEntries

type LockEntries []LockEntry

LockEntries - To sort the locks

func (LockEntries) Len

func (l LockEntries) Len() int

func (LockEntries) Less

func (l LockEntries) Less(i, j int) bool

func (LockEntries) Swap

func (l LockEntries) Swap(i, j int)

type LockEntry

type LockEntry struct {
	Timestamp  time.Time `json:"time"`       // When the lock was first granted
	Resource   string    `json:"resource"`   // Resource contains info like bucket+object
	Type       string    `json:"type"`       // Type indicates if 'Write' or 'Read' lock
	Source     string    `json:"source"`     // Source at which lock was granted
	ServerList []string  `json:"serverlist"` // List of servers participating in the lock.
	Owner      string    `json:"owner"`      // Owner UUID indicates server owns the lock.
	ID         string    `json:"id"`         // UID to uniquely identify request of client.
	// Represents quorum number of servers required to hold this lock, used to look for stale locks.
	Quorum int `json:"quorum"`
}

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.

type LogInfo

type LogInfo struct {
	ConsoleMsg string
	NodeName   string `json:"node"`
	Err        error  `json:"-"`
	// contains filtered or unexported fields
}

LogInfo holds console log messages

func (LogInfo) Mask

func (l LogInfo) Mask() uint64

Mask returns the mask based on the error level.

type LogKind

type LogKind string

LogKind specifies the kind of error log

const (
	// LogKindMinio Minio errors
	LogKindMinio LogKind = "MINIO"
	// LogKindApplication Application errors
	LogKindApplication LogKind = "APPLICATION"
	// LogKindAll All errors
	LogKindAll LogKind = "ALL"
)

func (LogKind) LogMask

func (l LogKind) LogMask() LogMask

LogMask returns the mask based on the kind.

func (LogKind) String

func (l LogKind) String() string

type LogMask

type LogMask uint64

LogMask is a bit mask for log types.

const (
	LogMaskMinIO LogMask = 1 << iota
	LogMaskApplication

	// LogMaskAll must be the last.
	LogMaskAll LogMask = (1 << iota) - 1
)

func (LogMask) Contains

func (m LogMask) Contains(other LogMask) bool

Contains returns whether all flags in other is present in t.

func (LogMask) Mask

func (m LogMask) Mask() uint64

Mask returns the LogMask as uint64

type Logger

type Logger map[string]Status

Logger contains logger status

type MRFStatus

type MRFStatus struct {
	BytesHealed uint64 `json:"bytes_healed"`
	ItemsHealed uint64 `json:"items_healed"`

	TotalItems uint64 `json:"total_items"`
	TotalBytes uint64 `json:"total_bytes"`

	Started time.Time `json:"started"`
}

MRFStatus exposes MRF metrics of a server

type MemInfo

type MemInfo struct {
	NodeCommon

	Total          uint64 `json:"total,omitempty"`
	Available      uint64 `json:"available,omitempty"`
	SwapSpaceTotal uint64 `json:"swap_space_total,omitempty"`
	SwapSpaceFree  uint64 `json:"swap_space_free,omitempty"`
	// Limit will store cgroup limit if configured and
	// less than Total, otherwise same as Total
	Limit uint64 `json:"limit,omitempty"`
}

MemInfo contains system's RAM and swap information.

func GetMemInfo

func GetMemInfo(ctx context.Context, addr string) MemInfo

GetMemInfo returns system's RAM and swap information.

type MemStats

type MemStats struct {
	Alloc      uint64
	TotalAlloc uint64
	Mallocs    uint64
	Frees      uint64
	HeapAlloc  uint64
}

MemStats is strip down version of runtime.MemStats containing memory stats of MinIO server.

type MetaStatus

type MetaStatus struct {
	IsSet bool   `json:"isSet"`
	Err   string `json:"error,omitempty"`
}

MetaStatus status of metadata import

type MetricType

type MetricType uint32

MetricType is a bitfield representation of different metric types.

const (
	MetricsScanner MetricType = 1 << (iota)
	MetricsDisk
	MetricsOS

	// MetricsAll must be last.
	// Enables all metrics.
	MetricsAll = 1<<(iota) - 1
)
const MetricsNone MetricType = 0

MetricsNone indicates no metrics.

func (MetricType) Contains

func (m MetricType) Contains(x MetricType) bool

Contains returns whether m contains all of x.

type Metrics

type Metrics struct {
	Scanner *ScannerMetrics `json:"scanner,omitempty"`
	Disk    *DiskMetric     `json:"disk,omitempty"`
	OS      *OSMetrics      `json:"os,omitempty"`
}

Metrics contains all metric types.

func (*Metrics) Merge

func (r *Metrics) Merge(other *Metrics)

Merge other into r.

type MetricsOptions

type MetricsOptions struct {
	Type     MetricType    // Return only these metric types. Several types can be combined using |. Leave at 0 to return all.
	N        int           // Maximum number of samples to return. 0 will return endless stream.
	Interval time.Duration // Interval between samples. Will be rounded up to 1s.
	Hosts    []string      // Leave empty for all
	ByHost   bool          // Return metrics by host.
	Disks    []string
	ByDisk   bool
}

MetricsOptions are options provided to Metrics call.

type MinIOOptions

type MinIOOptions func(*TierMinIO) error

MinIOOptions supports NewTierMinIO to take variadic options

type MinioConfig

type MinioConfig struct {
	Error string `json:"error,omitempty"`

	Config interface{} `json:"config,omitempty"`
}

MinioConfig contains minio configuration of a node.

type MinioHealthInfo

type MinioHealthInfo struct {
	Error string `json:"error,omitempty"`

	Config MinioConfig `json:"config,omitempty"`
	Info   MinioInfo   `json:"info,omitempty"`
}

MinioHealthInfo - Includes MinIO confifuration information

type MinioHealthInfoV0

type MinioHealthInfoV0 struct {
	Info   InfoMessage `json:"info,omitempty"`
	Config interface{} `json:"config,omitempty"`
	Error  string      `json:"error,omitempty"`
}

MinioHealthInfoV0 - Includes MinIO confifuration information

type MinioInfo

type MinioInfo struct {
	Mode         string       `json:"mode,omitempty"`
	Domain       []string     `json:"domain,omitempty"`
	Region       string       `json:"region,omitempty"`
	SQSARN       []string     `json:"sqsARN,omitempty"`
	DeploymentID string       `json:"deploymentID,omitempty"`
	Buckets      Buckets      `json:"buckets,omitempty"`
	Objects      Objects      `json:"objects,omitempty"`
	Usage        Usage        `json:"usage,omitempty"`
	Services     Services     `json:"services,omitempty"`
	Backend      interface{}  `json:"backend,omitempty"`
	Servers      []ServerInfo `json:"servers,omitempty"`
	TLS          *TLSInfo     `json:"tls"`
	IsKubernetes *bool        `json:"is_kubernetes"`
	IsDocker     *bool        `json:"is_docker"`
}

MinioInfo contains MinIO server and object storage information.

type NetLatency

type NetLatency struct {
	Avg          float64 `json:"avg_secs,omitempty"`
	Percentile50 float64 `json:"percentile50_secs,omitempty"`
	Percentile90 float64 `json:"percentile90_secs,omitempty"`
	Percentile99 float64 `json:"percentile99_secs,omitempty"`
	Min          float64 `json:"min_secs,omitempty"`
	Max          float64 `json:"max_secs,omitempty"`
}

NetLatency holds latency information for read/write operations to the drive

type NetPerfInfo

type NetPerfInfo struct {
	NodeCommon

	RemotePeers []PeerNetPerfInfo `json:"remote_peers,omitempty"`
}

NetPerfInfo contains network performance information of a node to other nodes.

type NetPerfInfoV0

type NetPerfInfoV0 struct {
	Addr       string        `json:"remote"`
	Latency    NetLatency    `json:"latency,omitempty"`
	Throughput NetThroughput `json:"throughput,omitempty"`
	Error      string        `json:"error,omitempty"`
}

NetPerfInfoV0 - one-to-one network connectivity Stats between 2 MinIO nodes

type NetThroughput

type NetThroughput struct {
	Avg          float64 `json:"avg_bytes_per_sec,omitempty"`
	Percentile50 float64 `json:"percentile50_bytes_per_sec,omitempty"`
	Percentile90 float64 `json:"percentile90_bytes_per_sec,omitempty"`
	Percentile99 float64 `json:"percentile99_bytes_per_sec,omitempty"`
	Min          float64 `json:"min_bytes_per_sec,omitempty"`
	Max          float64 `json:"max_bytes_per_sec,omitempty"`
}

NetThroughput holds throughput information for read/write operations to the drive

type NetperfNodeResult

type NetperfNodeResult struct {
	Endpoint string `json:"endpoint"`
	TX       uint64 `json:"tx"`
	RX       uint64 `json:"rx"`
	Error    string `json:"error,omitempty"`
}

NetperfNodeResult - stats from each server

type NetperfResult

type NetperfResult struct {
	NodeResults []NetperfNodeResult `json:"nodeResults"`
}

NetperfResult - aggregate results from all servers

type NodeCommon

type NodeCommon struct {
	Addr  string `json:"addr"`
	Error string `json:"error,omitempty"`
}

NodeCommon - Common fields across most node-specific health structs

func (*NodeCommon) GetAddr

func (n *NodeCommon) GetAddr() string

GetAddr - return the address of the node

func (*NodeCommon) SetAddr

func (n *NodeCommon) SetAddr(addr string)

SetAddr - set the address of the node

func (*NodeCommon) SetError

func (n *NodeCommon) SetError(err string)

SetError - set the address of the node

type NodeInfo

type NodeInfo interface {
	GetAddr() string
	SetAddr(addr string)
	SetError(err string)
}

NodeInfo - Interface to abstract any struct that contains address/endpoint and error fields

type OSInfo

type OSInfo struct {
	NodeCommon

	Info    host.InfoStat          `json:"info,omitempty"`
	Sensors []host.TemperatureStat `json:"sensors,omitempty"`
}

OSInfo contains operating system's information.

func GetOSInfo

func GetOSInfo(ctx context.Context, addr string) OSInfo

GetOSInfo returns linux only operating system's information.

type OSMetrics

type OSMetrics struct {
	// Time these metrics were collected
	CollectedAt time.Time `json:"collected"`

	// Number of accumulated operations by type since server restart.
	LifeTimeOps map[string]uint64 `json:"life_time_ops,omitempty"`

	// Last minute statistics.
	LastMinute struct {
		Operations map[string]TimedAction `json:"operations,omitempty"`
	} `json:"last_minute"`
}

OSMetrics contains metrics for OS operations.

func (*OSMetrics) Merge

func (o *OSMetrics) Merge(other *OSMetrics)

Merge other into 'o'.

type Objects

type Objects struct {
	Count uint64 `json:"count"`
	Error string `json:"error,omitempty"`
}

Objects contains the number of objects

type OpenIDProviderSettings

type OpenIDProviderSettings struct {
	ClaimName            string
	ClaimUserinfoEnabled bool
	RolePolicy           string
	ClientID             string
	HashedClientSecret   string
}

OpenIDProviderSettings contains info on a particular OIDC based provider.

type OpenIDSettings

type OpenIDSettings struct {
	// Enabled is true iff there is at least one OpenID provider configured.
	Enabled bool
	Region  string
	// Map of role ARN to provider info
	Roles map[string]OpenIDProviderSettings
	// Info on the claim based provider (all fields are empty if not
	// present)
	ClaimProvider OpenIDProviderSettings
}

OpenIDSettings contains OpenID configuration info of a cluster.

type Options

type Options struct {
	Creds  *credentials.Credentials
	Secure bool
}

Options for New method

type Partition

type Partition struct {
	Error string `json:"error,omitempty"`

	Device       string `json:"device,omitempty"`
	Mountpoint   string `json:"mountpoint,omitempty"`
	FSType       string `json:"fs_type,omitempty"`
	MountOptions string `json:"mount_options,omitempty"`
	MountFSType  string `json:"mount_fs_type,omitempty"`
	SpaceTotal   uint64 `json:"space_total,omitempty"`
	SpaceFree    uint64 `json:"space_free,omitempty"`
	InodeTotal   uint64 `json:"inode_total,omitempty"`
	InodeFree    uint64 `json:"inode_free,omitempty"`
}

Partition contains disk partition's information.

type PartitionStat

type PartitionStat struct {
	Device     string    `json:"device"`
	Mountpoint string    `json:"mountpoint,omitempty"`
	Fstype     string    `json:"fstype,omitempty"`
	Opts       string    `json:"opts,omitempty"`
	SmartInfo  SmartInfo `json:"smartInfo,omitempty"`
}

PartitionStat - includes data from both shirou/psutil.diskHw.PartitionStat as well as SMART data

type Partitions

type Partitions struct {
	NodeCommon

	Partitions []Partition `json:"partitions,omitempty"`
}

Partitions contains all disk partitions information of a node.

func GetPartitions

func GetPartitions(ctx context.Context, addr string) Partitions

GetPartitions returns all disk partitions information of a node running linux only operating system.

type PeerInfo

type PeerInfo struct {
	Endpoint string `json:"endpoint"`
	Name     string `json:"name"`
	// Deployment ID is useful as it is immutable - though endpoint may
	// change.
	DeploymentID string `json:"deploymentID"`
}

PeerInfo - contains some properties of a cluster peer.

type PeerNetPerfInfo

type PeerNetPerfInfo struct {
	NodeCommon

	Latency    Latency    `json:"latency,omitempty"`
	Throughput Throughput `json:"throughput,omitempty"`
}

PeerNetPerfInfo contains network performance information of a node.

type PeerSite

type PeerSite struct {
	Name      string `json:"name"`
	Endpoint  string `json:"endpoints"`
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
}

PeerSite - represents a cluster/site to be added to the set of replicated sites.

type PerfInfo

type PerfInfo struct {
	Drives      []DrivePerfInfos `json:"drives,omitempty"`
	Net         []NetPerfInfo    `json:"net,omitempty"`
	NetParallel NetPerfInfo      `json:"net_parallel,omitempty"`
}

PerfInfo - Includes Drive and Net perf info for the entire MinIO cluster

type PerfInfoV0

type PerfInfoV0 struct {
	DriveInfo   []ServerDrivesInfo    `json:"drives,omitempty"`
	Net         []ServerNetHealthInfo `json:"net,omitempty"`
	NetParallel ServerNetHealthInfo   `json:"net_parallel,omitempty"`
	Error       string                `json:"error,omitempty"`
}

PerfInfoV0 - Includes Drive and Net perf info for the entire MinIO cluster

type PolicyInfo

type PolicyInfo struct {
	PolicyName string
	Policy     json.RawMessage
	CreateDate time.Time `json:",omitempty"`
	UpdateDate time.Time `json:",omitempty"`
}

PolicyInfo contains information on a policy.

func (PolicyInfo) MarshalJSON

func (pi PolicyInfo) MarshalJSON() ([]byte, error)

MarshalJSON marshaller for JSON

type PoolDecommissionInfo

type PoolDecommissionInfo struct {
	StartTime   time.Time `json:"startTime"`
	StartSize   int64     `json:"startSize"`
	TotalSize   int64     `json:"totalSize"`
	CurrentSize int64     `json:"currentSize"`
	Complete    bool      `json:"complete"`
	Failed      bool      `json:"failed"`
	Canceled    bool      `json:"canceled"`
}

PoolDecommissionInfo currently draining information

type PoolStatus

type PoolStatus struct {
	ID           int                   `json:"id"`
	CmdLine      string                `json:"cmdline"`
	LastUpdate   time.Time             `json:"lastUpdate"`
	Decommission *PoolDecommissionInfo `json:"decommissionInfo,omitempty"`
}

PoolStatus captures current pool status

type ProcInfo

type ProcInfo struct {
	NodeCommon

	PID            int32                      `json:"pid,omitempty"`
	IsBackground   bool                       `json:"is_background,omitempty"`
	CPUPercent     float64                    `json:"cpu_percent,omitempty"`
	ChildrenPIDs   []int32                    `json:"children_pids,omitempty"`
	CmdLine        string                     `json:"cmd_line,omitempty"`
	NumConnections int                        `json:"num_connections,omitempty"`
	CreateTime     int64                      `json:"create_time,omitempty"`
	CWD            string                     `json:"cwd,omitempty"`
	ExecPath       string                     `json:"exec_path,omitempty"`
	GIDs           []int32                    `json:"gids,omitempty"`
	IOCounters     process.IOCountersStat     `json:"iocounters,omitempty"`
	IsRunning      bool                       `json:"is_running,omitempty"`
	MemInfo        process.MemoryInfoStat     `json:"mem_info,omitempty"`
	MemMaps        []process.MemoryMapsStat   `json:"mem_maps,omitempty"`
	MemPercent     float32                    `json:"mem_percent,omitempty"`
	Name           string                     `json:"name,omitempty"`
	Nice           int32                      `json:"nice,omitempty"`
	NumCtxSwitches process.NumCtxSwitchesStat `json:"num_ctx_switches,omitempty"`
	NumFDs         int32                      `json:"num_fds,omitempty"`
	NumThreads     int32                      `json:"num_threads,omitempty"`
	PageFaults     process.PageFaultsStat     `json:"page_faults,omitempty"`
	PPID           int32                      `json:"ppid,omitempty"`
	Status         string                     `json:"status,omitempty"`
	TGID           int32                      `json:"tgid,omitempty"`
	Times          cpu.TimesStat              `json:"times,omitempty"`
	UIDs           []int32                    `json:"uids,omitempty"`
	Username       string                     `json:"username,omitempty"`
}

ProcInfo contains current process's information.

func GetProcInfo

func GetProcInfo(ctx context.Context, addr string) ProcInfo

GetProcInfo returns current MinIO process information.

type ProfilerType

type ProfilerType string

ProfilerType represents the profiler type passed to the profiler subsystem.

const (
	ProfilerCPU        ProfilerType = "cpu"        // represents CPU profiler type
	ProfilerCPUIO      ProfilerType = "cpuio"      // represents CPU with IO (fgprof) profiler type
	ProfilerMEM        ProfilerType = "mem"        // represents MEM profiler type
	ProfilerBlock      ProfilerType = "block"      // represents Block profiler type
	ProfilerMutex      ProfilerType = "mutex"      // represents Mutex profiler type
	ProfilerTrace      ProfilerType = "trace"      // represents Trace profiler type
	ProfilerThreads    ProfilerType = "threads"    // represents ThreadCreate profiler type
	ProfilerGoroutines ProfilerType = "goroutines" // represents Goroutine dumps.
)

Different supported profiler types.

type QuotaType

type QuotaType string

QuotaType represents bucket quota type

const (
	// HardQuota specifies a hard quota of usage for bucket
	HardQuota QuotaType = "hard"
)

func (QuotaType) IsValid

func (t QuotaType) IsValid() bool

IsValid returns true if quota type is one of Hard

type RealtimeMetrics

type RealtimeMetrics struct {
	// Error indicates an error occurred.
	Errors []string `json:"errors,omitempty"`
	// Hosts indicates the scanned hosts
	Hosts      []string              `json:"hosts"`
	Aggregated Metrics               `json:"aggregated"`
	ByHost     map[string]Metrics    `json:"by_host,omitempty"`
	ByDisk     map[string]DiskMetric `json:"by_disk,omitempty"`
	// Final indicates whether this is the final packet and the receiver can exit.
	Final bool `json:"final"`
}

RealtimeMetrics provides realtime metrics. This is intended to be expanded over time to cover more types.

func (*RealtimeMetrics) Merge

func (r *RealtimeMetrics) Merge(other *RealtimeMetrics)

Merge will merge other into r.

type ReplDiffOpts

type ReplDiffOpts struct {
	ARN     string
	Verbose bool
	Prefix  string
}

ReplDiffOpts holds options for `mc replicate diff` command

type ReplicateAddStatus

type ReplicateAddStatus struct {
	Success                 bool   `json:"success"`
	Status                  string `json:"status"`
	ErrDetail               string `json:"errorDetail,omitempty"`
	InitialSyncErrorMessage string `json:"initialSyncErrorMessage,omitempty"`
}

ReplicateAddStatus - returns status of add request.

type ReplicateEditStatus

type ReplicateEditStatus struct {
	Success   bool   `json:"success"`
	Status    string `json:"status"`
	ErrDetail string `json:"errorDetail,omitempty"`
}

ReplicateEditStatus - returns status of edit request.

type ReplicateRemoveStatus

type ReplicateRemoveStatus struct {
	Status    string `json:"status"`
	ErrDetail string `json:"errorDetail,omitempty"`
}

ReplicateRemoveStatus - returns status of unlink request.

type Report

type Report struct {
	Report BucketBandwidthReport `json:"report"`
	Err    error                 `json:"error,omitempty"`
}

Report includes the bandwidth report or the error encountered.

type RequestData

type RequestData struct {
	CustomHeaders http.Header
	QueryValues   url.Values
	RelPath       string // URL path relative to admin API base endpoint
	Content       []byte
}

RequestData exposing internal data structure requestData

type S3Options

type S3Options func(*TierS3) error

S3Options supports NewTierS3 to take variadic options

type SRBucketInfo

type SRBucketInfo struct {
	Bucket string          `json:"bucket"`
	Policy json.RawMessage `json:"policy,omitempty"`

	// Since Versioning config does not have a json representation, we use
	// xml byte presentation directly.
	Versioning *string `json:"versioningConfig,omitempty"`

	// Since tags does not have a json representation, we use its xml byte
	// representation directly.
	Tags *string `json:"tags,omitempty"`

	// Since object lock does not have a json representation, we use its xml
	// byte representation.
	ObjectLockConfig *string `json:"objectLockConfig,omitempty"`

	// Since SSE config does not have a json representation, we use its xml
	// byte respresentation.
	SSEConfig *string `json:"sseConfig,omitempty"`
	// replication config in json representation
	ReplicationConfig *string `json:"replicationConfig,omitempty"`
	// quota config in json representation
	QuotaConfig *string `json:"quotaConfig,omitempty"`

	// time stamps of bucket metadata updates
	PolicyUpdatedAt            time.Time `json:"policyTimestamp,omitempty"`
	TagConfigUpdatedAt         time.Time `json:"tagTimestamp,omitempty"`
	ObjectLockConfigUpdatedAt  time.Time `json:"olockTimestamp,omitempty"`
	SSEConfigUpdatedAt         time.Time `json:"sseTimestamp,omitempty"`
	VersioningConfigUpdatedAt  time.Time `json:"versioningTimestamp,omitempty"`
	ReplicationConfigUpdatedAt time.Time `json:"replicationConfigTimestamp,omitempty"`
	QuotaConfigUpdatedAt       time.Time `json:"quotaTimestamp,omitempty"`
	CreatedAt                  time.Time `json:"bucketTimestamp,omitempty"`
	DeletedAt                  time.Time `json:"bucketDeletedTimestamp,omitempty"`
	Location                   string    `json:"location,omitempty"`
}

SRBucketInfo - returns all the bucket metadata available for bucket

type SRBucketMeta

type SRBucketMeta struct {
	Type   string          `json:"type"`
	Bucket string          `json:"bucket"`
	Policy json.RawMessage `json:"policy,omitempty"`

	// Since Versioning config does not have a json representation, we use
	// xml byte presentation directly.
	Versioning *string `json:"versioningConfig,omitempty"`

	// Since tags does not have a json representation, we use its xml byte
	// representation directly.
	Tags *string `json:"tags,omitempty"`

	// Since object lock does not have a json representation, we use its xml
	// byte representation.
	ObjectLockConfig *string `json:"objectLockConfig,omitempty"`

	// Since SSE config does not have a json representation, we use its xml
	// byte respresentation.
	SSEConfig *string `json:"sseConfig,omitempty"`

	// Quota has a json representation use it as is.
	Quota json.RawMessage `json:"quota,omitempty"`

	// UpdatedAt - timestamp of last update
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

SRBucketMeta - represents a bucket metadata change that will be copied to a peer.

type SRBucketStatsSummary

type SRBucketStatsSummary struct {
	DeploymentID             string
	HasBucket                bool
	BucketMarkedDeleted      bool
	TagMismatch              bool
	VersioningConfigMismatch bool
	OLockConfigMismatch      bool
	PolicyMismatch           bool
	SSEConfigMismatch        bool
	ReplicationCfgMismatch   bool
	QuotaCfgMismatch         bool
	HasTagsSet               bool
	HasOLockConfigSet        bool
	HasPolicySet             bool
	HasSSECfgSet             bool
	HasReplicationCfg        bool
	HasQuotaCfgSet           bool
}

SRBucketStatsSummary has status of bucket metadata replication misses

type SREntityType

type SREntityType int

SREntityType specifies type of entity

const (
	// Unspecified entity
	Unspecified SREntityType = iota

	// SRBucketEntity Bucket entity type
	SRBucketEntity

	// SRPolicyEntity Policy entity type
	SRPolicyEntity

	// SRUserEntity User entity type
	SRUserEntity

	// SRGroupEntity Group entity type
	SRGroupEntity
)

func GetSREntityType

func GetSREntityType(name string) SREntityType

GetSREntityType returns the SREntityType for a key

type SRGroupInfo

type SRGroupInfo struct {
	UpdateReq GroupAddRemove `json:"updateReq"`
}

SRGroupInfo - represents a regular (IAM) user to be replicated.

type SRGroupStatsSummary

type SRGroupStatsSummary struct {
	DeploymentID      string
	PolicyMismatch    bool
	HasGroup          bool
	GroupDescMismatch bool
	HasPolicyMapping  bool
}

SRGroupStatsSummary has status of group replication misses

type SRIAMItem

type SRIAMItem struct {
	Type string `json:"type"`

	// Name and Policy below are used when Type == SRIAMItemPolicy
	Name   string          `json:"name"`
	Policy json.RawMessage `json:"policy"`

	// Used when Type == SRIAMItemPolicyMapping
	PolicyMapping *SRPolicyMapping `json:"policyMapping"`

	// Used when Type == SRIAMItemSvcAcc
	SvcAccChange *SRSvcAccChange `json:"serviceAccountChange"`

	// Used when Type = SRIAMItemSTSAcc
	STSCredential *SRSTSCredential `json:"stsCredential"`

	// Used when Type = SRIAMItemIAMUser
	IAMUser *SRIAMUser `json:"iamUser"`

	// Used when Type = SRIAMItemGroupInfo
	GroupInfo *SRGroupInfo `json:"groupInfo"`

	// UpdatedAt - timestamp of last update
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

SRIAMItem - represents an IAM object that will be copied to a peer.

type SRIAMPolicy

type SRIAMPolicy struct {
	Policy    json.RawMessage `json:"policy"`
	UpdatedAt time.Time       `json:"updatedAt,omitempty"`
}

SRIAMPolicy - represents an IAM policy.

type SRIAMUser

type SRIAMUser struct {
	AccessKey   string              `json:"accessKey"`
	IsDeleteReq bool                `json:"isDeleteReq"`
	UserReq     *AddOrUpdateUserReq `json:"userReq"`
}

SRIAMUser - represents a regular (IAM) user to be replicated. A nil UserReq implies that a user delete operation should be replicated on the peer cluster.

type SRInfo

type SRInfo struct {
	Enabled        bool
	Name           string
	DeploymentID   string
	Buckets        map[string]SRBucketInfo       // map of bucket metadata info
	Policies       map[string]SRIAMPolicy        //  map of IAM policy name to content
	UserPolicies   map[string]SRPolicyMapping    // map of username -> user policy mapping
	UserInfoMap    map[string]UserInfo           // map of user name to UserInfo
	GroupDescMap   map[string]GroupDesc          // map of group name to GroupDesc
	GroupPolicies  map[string]SRPolicyMapping    // map of groupname -> group policy mapping
	ReplicationCfg map[string]replication.Config // map of bucket -> replication config
}

SRInfo gets replication metadata for a site

type SRPeerJoinReq

type SRPeerJoinReq struct {
	SvcAcctAccessKey string              `json:"svcAcctAccessKey"`
	SvcAcctSecretKey string              `json:"svcAcctSecretKey"`
	SvcAcctParent    string              `json:"svcAcctParent"`
	Peers            map[string]PeerInfo `json:"peers"`
}

SRPeerJoinReq - arg body for SRPeerJoin

type SRPolicyMapping

type SRPolicyMapping struct {
	UserOrGroup string    `json:"userOrGroup"`
	UserType    int       `json:"userType"`
	IsGroup     bool      `json:"isGroup"`
	Policy      string    `json:"policy"`
	CreatedAt   time.Time `json:"createdAt,omitempty"`
	UpdatedAt   time.Time `json:"updatedAt,omitempty"`
}

SRPolicyMapping - represents mapping of a policy to a user or group.

type SRPolicyStatsSummary

type SRPolicyStatsSummary struct {
	DeploymentID   string
	PolicyMismatch bool
	HasPolicy      bool
}

SRPolicyStatsSummary has status of policy replication misses

type SRRemoveReq

type SRRemoveReq struct {
	SiteNames []string `json:"sites"`
	RemoveAll bool     `json:"all"` // true if all sites are to be removed.
}

SRRemoveReq - arg body for SRRemoveReq

type SRSTSCredential

type SRSTSCredential struct {
	AccessKey           string `json:"accessKey"`
	SecretKey           string `json:"secretKey"`
	SessionToken        string `json:"sessionToken"`
	ParentUser          string `json:"parentUser"`
	ParentPolicyMapping string `json:"parentPolicyMapping,omitempty"`
}

SRSTSCredential - represents an STS credential to be replicated.

type SRSiteSummary

type SRSiteSummary struct {
	ReplicatedBuckets             int // count of buckets replicated across sites
	ReplicatedTags                int // count of buckets with tags replicated across sites
	ReplicatedBucketPolicies      int // count of policies replicated across sites
	ReplicatedIAMPolicies         int // count of IAM policies replicated across sites
	ReplicatedUsers               int // count of users replicated across sites
	ReplicatedGroups              int // count of groups replicated across sites
	ReplicatedLockConfig          int // count of object lock config replicated across sites
	ReplicatedSSEConfig           int // count of SSE config replicated across sites
	ReplicatedVersioningConfig    int // count of versioning config replicated across sites
	ReplicatedQuotaConfig         int // count of bucket with quota config replicated across sites
	ReplicatedUserPolicyMappings  int // count of user policy mappings replicated across sites
	ReplicatedGroupPolicyMappings int // count of group policy mappings replicated across sites

	TotalBucketsCount            int // total buckets on this site
	TotalTagsCount               int // total count of buckets with tags on this site
	TotalBucketPoliciesCount     int // total count of buckets with bucket policies for this site
	TotalIAMPoliciesCount        int // total count of IAM policies for this site
	TotalLockConfigCount         int // total count of buckets with object lock config for this site
	TotalSSEConfigCount          int // total count of buckets with SSE config
	TotalVersioningConfigCount   int // total count of bucekts with versioning config
	TotalQuotaConfigCount        int // total count of buckets with quota config
	TotalUsersCount              int // total number of users seen on this site
	TotalGroupsCount             int // total number of groups seen on this site
	TotalUserPolicyMappingCount  int // total number of user policy mappings seen on this site
	TotalGroupPolicyMappingCount int // total number of group policy mappings seen on this site
}

SRSiteSummary holds the count of replicated items in site replication

type SRStatusInfo

type SRStatusInfo struct {
	Enabled      bool
	MaxBuckets   int                      // maximum buckets seen across sites
	MaxUsers     int                      // maximum users seen across sites
	MaxGroups    int                      // maximum groups seen across sites
	MaxPolicies  int                      // maximum policies across sites
	Sites        map[string]PeerInfo      // deployment->sitename
	StatsSummary map[string]SRSiteSummary // map of deployment id -> site stat
	// BucketStats map of bucket to slice of deployment IDs with stats. This is populated only if there are
	// mismatches or if a specific bucket's stats are requested
	BucketStats map[string]map[string]SRBucketStatsSummary
	// PolicyStats map of policy to slice of deployment IDs with stats. This is populated only if there are
	// mismatches or if a specific bucket's stats are requested
	PolicyStats map[string]map[string]SRPolicyStatsSummary
	// UserStats map of user to slice of deployment IDs with stats. This is populated only if there are
	// mismatches or if a specific bucket's stats are requested
	UserStats map[string]map[string]SRUserStatsSummary
	// GroupStats map of group to slice of deployment IDs with stats. This is populated only if there are
	// mismatches or if a specific bucket's stats are requested
	GroupStats map[string]map[string]SRGroupStatsSummary
}

SRStatusInfo returns detailed status on site replication status

type SRStatusOptions

type SRStatusOptions struct {
	Buckets     bool
	Policies    bool
	Users       bool
	Groups      bool
	Entity      SREntityType
	EntityValue string
	ShowDeleted bool
}

SRStatusOptions holds SR status options

func (*SRStatusOptions) IsEntitySet

func (o *SRStatusOptions) IsEntitySet() bool

IsEntitySet returns true if entity option is set

type SRSvcAccChange

type SRSvcAccChange struct {
	Create *SRSvcAccCreate `json:"crSvcAccCreate"`
	Update *SRSvcAccUpdate `json:"crSvcAccUpdate"`
	Delete *SRSvcAccDelete `json:"crSvcAccDelete"`
}

SRSvcAccChange - sum-type to represent an svc account change.

type SRSvcAccCreate

type SRSvcAccCreate struct {
	Parent        string                 `json:"parent"`
	AccessKey     string                 `json:"accessKey"`
	SecretKey     string                 `json:"secretKey"`
	Groups        []string               `json:"groups"`
	Claims        map[string]interface{} `json:"claims"`
	SessionPolicy json.RawMessage        `json:"sessionPolicy"`
	Status        string                 `json:"status"`
}

SRSvcAccCreate - create operation

type SRSvcAccDelete

type SRSvcAccDelete struct {
	AccessKey string `json:"accessKey"`
}

SRSvcAccDelete - delete operation

type SRSvcAccUpdate

type SRSvcAccUpdate struct {
	AccessKey     string          `json:"accessKey"`
	SecretKey     string          `json:"secretKey"`
	Status        string          `json:"status"`
	SessionPolicy json.RawMessage `json:"sessionPolicy"`
}

SRSvcAccUpdate - update operation

type SRUserStatsSummary

type SRUserStatsSummary struct {
	DeploymentID     string
	PolicyMismatch   bool
	UserInfoMismatch bool
	HasUser          bool
	HasPolicyMapping bool
}

SRUserStatsSummary has status of user replication misses

type ScannerMetrics

type ScannerMetrics struct {
	// Time these metrics were collected
	CollectedAt time.Time `json:"collected"`

	// Current scanner cycle
	CurrentCycle uint64 `json:"current_cycle"`

	// Start time of current cycle
	CurrentStarted time.Time `json:"current_started"`

	// History of when last cycles completed
	CyclesCompletedAt []time.Time `json:"cycle_complete_times"`

	// Number of accumulated operations by type since server restart.
	LifeTimeOps map[string]uint64 `json:"life_time_ops,omitempty"`

	// Number of accumulated ILM operations by type since server restart.
	LifeTimeILM map[string]uint64 `json:"ilm_ops,omitempty"`

	// Last minute operation statistics.
	LastMinute struct {
		// Scanner actions.
		Actions map[string]TimedAction `json:"actions,omitempty"`
		// ILM actions.
		ILM map[string]TimedAction `json:"ilm,omitempty"`
	} `json:"last_minute"`

	// Currently active path(s) being scanned.
	ActivePaths []string `json:"active,omitempty"`
}

ScannerMetrics contains scanner information.

func (*ScannerMetrics) Merge

func (s *ScannerMetrics) Merge(other *ScannerMetrics)

Merge other into 's'.

type ServerCPUInfo

type ServerCPUInfo struct {
	Addr     string          `json:"addr"`
	CPUStat  []cpu.InfoStat  `json:"cpu,omitempty"`
	TimeStat []cpu.TimesStat `json:"time,omitempty"`
	Error    string          `json:"error,omitempty"`
}

ServerCPUInfo - Includes cpu and timer stats of each node of the MinIO cluster

type ServerDiskHwInfo

type ServerDiskHwInfo struct {
	Addr       string                           `json:"addr"`
	Usage      []*diskhw.UsageStat              `json:"usages,omitempty"`
	Partitions []PartitionStat                  `json:"partitions,omitempty"`
	Counters   map[string]diskhw.IOCountersStat `json:"counters,omitempty"`
	Error      string                           `json:"error,omitempty"`
}

ServerDiskHwInfo - Includes usage counters, disk counters and partitions

func (*ServerDiskHwInfo) GetTotalCapacity

func (s *ServerDiskHwInfo) GetTotalCapacity() (capacity uint64)

GetTotalCapacity gets the total capacity a server holds.

func (*ServerDiskHwInfo) GetTotalFreeCapacity

func (s *ServerDiskHwInfo) GetTotalFreeCapacity() (capacity uint64)

GetTotalFreeCapacity gets the total capacity that is free.

func (*ServerDiskHwInfo) GetTotalUsedCapacity

func (s *ServerDiskHwInfo) GetTotalUsedCapacity() (capacity uint64)

GetTotalUsedCapacity gets the total capacity used.

type ServerDrivesInfo

type ServerDrivesInfo struct {
	Addr     string            `json:"addr"`
	Serial   []DrivePerfInfoV0 `json:"serial,omitempty"`   // Drive perf info collected one drive at a time
	Parallel []DrivePerfInfoV0 `json:"parallel,omitempty"` // Drive perf info collected in parallel
	Error    string            `json:"error,omitempty"`
}

ServerDrivesInfo - Drive info about all drives in a single MinIO node

type ServerInfo

type ServerInfo struct {
	State          string            `json:"state,omitempty"`
	Endpoint       string            `json:"endpoint,omitempty"`
	Uptime         int64             `json:"uptime,omitempty"`
	Version        string            `json:"version,omitempty"`
	CommitID       string            `json:"commitID,omitempty"`
	Network        map[string]string `json:"network,omitempty"`
	Drives         []Disk            `json:"drives,omitempty"`
	PoolNumber     int               `json:"poolNumber,omitempty"`
	MemStats       MemStats          `json:"mem_stats"`
	GOMAXPROCS     int               `json:"gomaxprocs"`
	NumCPU         int               `json:"num_cpu"`
	RuntimeVersion string            `json:"runtime_version"`
	GCStats        GCStats           `json:"gc_stats"`
	MinioEnvVars   map[string]string `json:"minio_env_vars"`
}

ServerInfo holds server information

type ServerMemInfo

type ServerMemInfo struct {
	Addr       string                 `json:"addr"`
	SwapMem    *mem.SwapMemoryStat    `json:"swap,omitempty"`
	VirtualMem *mem.VirtualMemoryStat `json:"virtualmem,omitempty"`
	Error      string                 `json:"error,omitempty"`
}

ServerMemInfo - Includes host virtual and swap mem information

type ServerNetHealthInfo

type ServerNetHealthInfo struct {
	Addr  string          `json:"addr"`
	Net   []NetPerfInfoV0 `json:"net,omitempty"`
	Error string          `json:"error,omitempty"`
}

ServerNetHealthInfo - Network health info about a single MinIO node

type ServerOsInfo

type ServerOsInfo struct {
	Addr    string                 `json:"addr"`
	Info    *host.InfoStat         `json:"info,omitempty"`
	Sensors []host.TemperatureStat `json:"sensors,omitempty"`
	Users   []host.UserStat        `json:"users,omitempty"`
	Error   string                 `json:"error,omitempty"`
}

ServerOsInfo - Includes host os information

type ServerProcInfo

type ServerProcInfo struct {
	Addr      string       `json:"addr"`
	Processes []SysProcess `json:"processes,omitempty"`
	Error     string       `json:"error,omitempty"`
}

ServerProcInfo - Includes host process lvl information

type ServerProperties

type ServerProperties struct {
	State      string            `json:"state,omitempty"`
	Endpoint   string            `json:"endpoint,omitempty"`
	Scheme     string            `json:"scheme,omitempty"`
	Uptime     int64             `json:"uptime,omitempty"`
	Version    string            `json:"version,omitempty"`
	CommitID   string            `json:"commitID,omitempty"`
	Network    map[string]string `json:"network,omitempty"`
	Disks      []Disk            `json:"drives,omitempty"`
	PoolNumber int               `json:"poolNumber,omitempty"`
	MemStats   MemStats          `json:"mem_stats"`
}

ServerProperties holds server information

type ServerUpdateStatus

type ServerUpdateStatus struct {
	CurrentVersion string `json:"currentVersion"`
	UpdatedVersion string `json:"updatedVersion"`
}

ServerUpdateStatus - contains the response of service update API

type ServiceAction

type ServiceAction string

ServiceAction - type to restrict service-action values

type ServiceTraceInfo

type ServiceTraceInfo struct {
	Trace TraceInfo
	Err   error `json:"-"`
}

ServiceTraceInfo holds http trace

type ServiceTraceOpts

type ServiceTraceOpts struct {
	// Trace types:
	S3           bool
	Internal     bool
	Storage      bool
	OS           bool
	Scanner      bool
	Decommission bool
	Healing      bool

	OnlyErrors bool
	Threshold  time.Duration
}

ServiceTraceOpts holds tracing options

func (ServiceTraceOpts) AddParams

func (t ServiceTraceOpts) AddParams(u url.Values)

AddParams will add parameter to url values.

func (*ServiceTraceOpts) ParseParams

func (t *ServiceTraceOpts) ParseParams(r *http.Request) (err error)

ParseParams will parse parameters and set them to t.

func (ServiceTraceOpts) TraceTypes

func (t ServiceTraceOpts) TraceTypes() TraceType

TraceTypes returns the enabled traces as a bitfield value.

type ServiceType

type ServiceType string

ServiceType represents service type

const (
	// ReplicationService specifies replication service
	ReplicationService ServiceType = "replication"
)

func (ServiceType) IsValid

func (t ServiceType) IsValid() bool

IsValid returns true if ARN type represents replication

type Services

type Services struct {
	KMS           KMS                           `json:"kms,omitempty"`
	LDAP          LDAP                          `json:"ldap,omitempty"`
	Logger        []Logger                      `json:"logger,omitempty"`
	Audit         []Audit                       `json:"audit,omitempty"`
	Notifications []map[string][]TargetIDStatus `json:"notifications,omitempty"`
}

Services contains different services information

type SetStatus

type SetStatus struct {
	ID           string `json:"id"`
	PoolIndex    int    `json:"pool_index"`
	SetIndex     int    `json:"set_index"`
	HealStatus   string `json:"heal_status"`
	HealPriority string `json:"heal_priority"`
	TotalObjects int    `json:"total_objects"`
	Disks        []Disk `json:"disks"`
}

SetStatus contains information about the heal status of a set.

type SiteReplicationInfo

type SiteReplicationInfo struct {
	Enabled                 bool       `json:"enabled"`
	Name                    string     `json:"name,omitempty"`
	Sites                   []PeerInfo `json:"sites,omitempty"`
	ServiceAccountAccessKey string     `json:"serviceAccountAccessKey,omitempty"`
}

SiteReplicationInfo - contains cluster replication information.

type SmartAtaInfo

type SmartAtaInfo struct {
	LUWWNDeviceID         string `json:"scsiLuWWNDeviceID,omitempty"`
	SerialNum             string `json:"serialNum,omitempty"`
	ModelNum              string `json:"modelNum,omitempty"`
	FirmwareRevision      string `json:"firmwareRevision,omitempty"`
	RotationRate          string `json:"RotationRate,omitempty"`
	ATAMajorVersion       string `json:"MajorVersion,omitempty"`
	ATAMinorVersion       string `json:"MinorVersion,omitempty"`
	SmartSupportAvailable bool   `json:"smartSupportAvailable,omitempty"`
	SmartSupportEnabled   bool   `json:"smartSupportEnabled,omitempty"`
	ErrorLog              string `json:"smartErrorLog,omitempty"`
	Transport             string `json:"transport,omitempty"`
}

SmartAtaInfo contains ATA drive info

type SmartInfo

type SmartInfo struct {
	Device string         `json:"device"`
	Scsi   *SmartScsiInfo `json:"scsi,omitempty"`
	Nvme   *SmartNvmeInfo `json:"nvme,omitempty"`
	Ata    *SmartAtaInfo  `json:"ata,omitempty"`
}

SmartInfo contains S.M.A.R.T data about the drive

type SmartNvmeInfo

type SmartNvmeInfo struct {
	SerialNum       string `json:"serialNum,omitempty"`
	VendorID        string `json:"vendorId,omitempty"`
	FirmwareVersion string `json:"firmwareVersion,omitempty"`
	ModelNum        string `json:"modelNum,omitempty"`
	SpareAvailable  string `json:"spareAvailable,omitempty"`
	SpareThreshold  string `json:"spareThreshold,omitempty"`
	Temperature     string `json:"temperature,omitempty"`
	CriticalWarning string `json:"criticalWarning,omitempty"`

	MaxDataTransferPages        int      `json:"maxDataTransferPages,omitempty"`
	ControllerBusyTime          *big.Int `json:"controllerBusyTime,omitempty"`
	PowerOnHours                *big.Int `json:"powerOnHours,omitempty"`
	PowerCycles                 *big.Int `json:"powerCycles,omitempty"`
	UnsafeShutdowns             *big.Int `json:"unsafeShutdowns,omitempty"`
	MediaAndDataIntegrityErrors *big.Int `json:"mediaAndDataIntgerityErrors,omitempty"`
	DataUnitsReadBytes          *big.Int `json:"dataUnitsReadBytes,omitempty"`
	DataUnitsWrittenBytes       *big.Int `json:"dataUnitsWrittenBytes,omitempty"`
	HostReadCommands            *big.Int `json:"hostReadCommands,omitempty"`
	HostWriteCommands           *big.Int `json:"hostWriteCommands,omitempty"`
}

SmartNvmeInfo contains NVMe drive info

type SmartScsiInfo

type SmartScsiInfo struct {
	CapacityBytes int64  `json:"scsiCapacityBytes,omitempty"`
	ModeSenseBuf  string `json:"scsiModeSenseBuf,omitempty"`
	RespLen       int64  `json:"scsirespLen,omitempty"`
	BdLen         int64  `json:"scsiBdLen,omitempty"`
	Offset        int64  `json:"scsiOffset,omitempty"`
	RPM           int64  `json:"sciRpm,omitempty"`
}

SmartScsiInfo contains SCSI drive Info

type SpeedTestResult

type SpeedTestResult struct {
	Version    string `json:"version"`
	Servers    int    `json:"servers"`
	Disks      int    `json:"disks"`
	Size       int    `json:"size"`
	Concurrent int    `json:"concurrent"`
	PUTStats   SpeedTestStats
	GETStats   SpeedTestStats
}

SpeedTestResult - result of the speedtest() call

type SpeedTestResults

type SpeedTestResults struct {
	DrivePerf []DriveSpeedTestResult `json:"drive,omitempty"`
	ObjPerf   []SpeedTestResult      `json:"obj,omitempty"`
	NetPerf   []NetperfNodeResult    `json:"net,omitempty"`
	Error     string                 `json:"error,omitempty"`
}

SpeedTestResults - Includes perf test results of the MinIO cluster

type SpeedTestStatServer

type SpeedTestStatServer struct {
	Endpoint         string `json:"endpoint"`
	ThroughputPerSec uint64 `json:"throughputPerSec"`
	ObjectsPerSec    uint64 `json:"objectsPerSec"`
	Err              string `json:"err"`
}

SpeedTestStatServer - stats of a server

type SpeedTestStats

type SpeedTestStats struct {
	ThroughputPerSec uint64                `json:"throughputPerSec"`
	ObjectsPerSec    uint64                `json:"objectsPerSec"`
	Response         Timings               `json:"responseTime"`
	TTFB             Timings               `json:"ttfb,omitempty"`
	Servers          []SpeedTestStatServer `json:"servers"`
}

SpeedTestStats - stats of all the servers

type SpeedtestOpts

type SpeedtestOpts struct {
	Size         int           // Object size used in speed test
	Concurrency  int           // Concurrency used in speed test
	Duration     time.Duration // Total duration of the speed test
	Autotune     bool          // Enable autotuning
	StorageClass string        // Choose type of storage-class to be used while performing I/O
	Bucket       string        // Choose a custom bucket name while performing I/O
}

SpeedtestOpts provide configurable options for speedtest

type StartProfilingResult

type StartProfilingResult struct {
	NodeName string `json:"nodeName"`
	Success  bool   `json:"success"`
	Error    string `json:"error"`
}

StartProfilingResult holds the result of starting profiler result in a given node.

type Status

type Status struct {
	Status string `json:"status,omitempty"`
}

Status of endpoint

type StorageInfo

type StorageInfo struct {
	Disks []Disk

	// Backend type.
	Backend BackendInfo
}

StorageInfo - represents total capacity of underlying storage.

type SubnetLoginReq

type SubnetLoginReq struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

SubnetLoginReq - JSON payload of the SUBNET login api

type SubnetMFAReq

type SubnetMFAReq struct {
	Username string `json:"username"`
	OTP      string `json:"otp"`
	Token    string `json:"token"`
}

SubnetMFAReq - JSON payload of the SUBNET mfa api

type SubsysConfig

type SubsysConfig struct {
	SubSystem string `json:"subSystem"`
	Target    string `json:"target,omitempty"`

	// WARNING: Use AddConfigKV() to mutate this.
	KV []ConfigKV `json:"kv"`
	// contains filtered or unexported fields
}

SubsysConfig represents the configuration for a particular subsytem and target.

func ParseServerConfigOutput

func ParseServerConfigOutput(serverConfigOutput string) ([]SubsysConfig, error)

ParseServerConfigOutput - takes a server config output and returns a slice of configs. Depending on the server config get API request, this may return configuration info for one or more configuration sub-systems.

A configuration subsystem in the server may have one or more subsystem targets (named instances of the sub-system, for example `notify_postres`, `logger_webhook` or `identity_openid`). For every subsystem and target returned in `serverConfigOutput`, this function returns a separate `SubsysConfig` value in the output slice. The default target is returned as "" (empty string) by this function.

Use the `Lookup()` function on the `SubsysConfig` type to query a subsystem-target pair for a configuration parameter. This returns the effective value (i.e. possibly overridden by an environment variable) of the configuration parameter on the server.

func (*SubsysConfig) AddConfigKV

func (c *SubsysConfig) AddConfigKV(ckv ConfigKV)

AddConfigKV - adds a config parameter to the subsystem.

func (*SubsysConfig) Lookup

func (c *SubsysConfig) Lookup(key string) (val string, present bool)

Lookup resolves the value of a config parameter. If an env variable is specified on the server for the parameter, it is returned.

type SysConfig

type SysConfig struct {
	NodeCommon

	Config map[string]interface{} `json:"config,omitempty"`
}

SysConfig - info about services that affect minio

func GetSysConfig

func GetSysConfig(ctx context.Context, addr string) SysConfig

GetSysConfig returns config values from the system (only those affecting minio performance)

type SysErrors

type SysErrors struct {
	NodeCommon

	Errors []string `json:"errors,omitempty"`
}

SysErrors - contains a system error

func GetSysErrors

func GetSysErrors(ctx context.Context, addr string) SysErrors

GetSysErrors returns issues in system setup/config

type SysHealthInfo

type SysHealthInfo struct {
	CPUInfo    []ServerCPUInfo    `json:"cpus,omitempty"`
	DiskHwInfo []ServerDiskHwInfo `json:"drives,omitempty"`
	OsInfo     []ServerOsInfo     `json:"osinfos,omitempty"`
	MemInfo    []ServerMemInfo    `json:"meminfos,omitempty"`
	ProcInfo   []ServerProcInfo   `json:"procinfos,omitempty"`
	Error      string             `json:"error,omitempty"`
}

SysHealthInfo - Includes hardware and system information of the MinIO cluster

type SysInfo

type SysInfo struct {
	CPUInfo        []CPUs         `json:"cpus,omitempty"`
	Partitions     []Partitions   `json:"partitions,omitempty"`
	OSInfo         []OSInfo       `json:"osinfo,omitempty"`
	MemInfo        []MemInfo      `json:"meminfo,omitempty"`
	ProcInfo       []ProcInfo     `json:"procinfo,omitempty"`
	SysErrs        []SysErrors    `json:"errors,omitempty"`
	SysServices    []SysServices  `json:"services,omitempty"`
	SysConfig      []SysConfig    `json:"config,omitempty"`
	KubernetesInfo KubernetesInfo `json:"kubernetes"`
}

SysInfo - Includes hardware and system information of the MinIO cluster

type SysProcess

type SysProcess struct {
	Pid             int32                       `json:"pid"`
	Background      bool                        `json:"background,omitempty"`
	CPUPercent      float64                     `json:"cpupercent,omitempty"`
	Children        []int32                     `json:"children,omitempty"`
	CmdLine         string                      `json:"cmd,omitempty"`
	ConnectionCount int                         `json:"connection_count,omitempty"`
	CreateTime      int64                       `json:"createtime,omitempty"`
	Cwd             string                      `json:"cwd,omitempty"`
	Exe             string                      `json:"exe,omitempty"`
	Gids            []int32                     `json:"gids,omitempty"`
	IOCounters      *process.IOCountersStat     `json:"iocounters,omitempty"`
	IsRunning       bool                        `json:"isrunning,omitempty"`
	MemInfo         *process.MemoryInfoStat     `json:"meminfo,omitempty"`
	MemMaps         *[]process.MemoryMapsStat   `json:"memmaps,omitempty"`
	MemPercent      float32                     `json:"mempercent,omitempty"`
	Name            string                      `json:"name,omitempty"`
	Nice            int32                       `json:"nice,omitempty"`
	NumCtxSwitches  *process.NumCtxSwitchesStat `json:"numctxswitches,omitempty"`
	NumFds          int32                       `json:"numfds,omitempty"`
	NumThreads      int32                       `json:"numthreads,omitempty"`
	PageFaults      *process.PageFaultsStat     `json:"pagefaults,omitempty"`
	Parent          int32                       `json:"parent,omitempty"`
	Ppid            int32                       `json:"ppid,omitempty"`
	Status          string                      `json:"status,omitempty"`
	Tgid            int32                       `json:"tgid,omitempty"`
	Times           *cpu.TimesStat              `json:"cputimes,omitempty"`
	Uids            []int32                     `json:"uids,omitempty"`
	Username        string                      `json:"username,omitempty"`
}

SysProcess - Includes process lvl information about a single process

func (SysProcess) GetOwner

func (sp SysProcess) GetOwner() string

GetOwner - returns owner of the process

type SysService

type SysService struct {
	Name   string `json:"name"`
	Status string `json:"status"`
}

SysService - name and status of a sys service

type SysServices

type SysServices struct {
	NodeCommon

	Services []SysService `json:"services,omitempty"`
}

SysServices - info about services that affect minio

func GetSysServices

func GetSysServices(ctx context.Context, addr string) SysServices

GetSysServices returns info of sys services that affect minio

type TLSCert

type TLSCert struct {
	PubKeyAlgo    string    `json:"pub_key_algo"`
	SignatureAlgo string    `json:"signature_algo"`
	NotBefore     time.Time `json:"not_before"`
	NotAfter      time.Time `json:"not_after"`
}

type TLSInfo

type TLSInfo struct {
	TLSEnabled bool      `json:"tls_enabled"`
	Certs      []TLSCert `json:"certs,omitempty"`
}

type TargetIDStatus

type TargetIDStatus map[string]Status

TargetIDStatus containsid and status

type TargetUpdateType

type TargetUpdateType int

TargetUpdateType - type of update on the remote target

const (
	// CredentialsUpdateType update creds
	CredentialsUpdateType TargetUpdateType = 1 + iota
	// SyncUpdateType update synchronous replication setting
	SyncUpdateType
	// ProxyUpdateType update proxy setting
	ProxyUpdateType
	// BandwidthLimitUpdateType update bandwidth limit
	BandwidthLimitUpdateType
	// HealthCheckDurationUpdateType update health check duration
	HealthCheckDurationUpdateType
	// PathUpdateType update Path
	PathUpdateType
	// ResetUpdateType sets ResetBeforeDate and ResetID on a bucket target
	ResetUpdateType
)

func GetTargetUpdateOps

func GetTargetUpdateOps(values url.Values) []TargetUpdateType

GetTargetUpdateOps returns a slice of update operations being performed with `mc admin bucket remote edit`

type TgtDiffInfo

type TgtDiffInfo struct {
	ReplicationStatus       string `json:"rStatus,omitempty"`  // target replication status
	DeleteReplicationStatus string `json:"drStatus,omitempty"` // target delete replication status
}

TgtDiffInfo returns status of unreplicated objects for the target ARN

type Throughput

type Throughput struct {
	Avg          uint64 `json:"avg"`
	Max          uint64 `json:"max"`
	Min          uint64 `json:"min"`
	Percentile50 uint64 `json:"percentile_50"`
	Percentile90 uint64 `json:"percentile_90"`
	Percentile99 uint64 `json:"percentile_99"`
}

Throughput contains write performance in bytes per second of a disk drive.

type TierAzure

type TierAzure struct {
	Endpoint     string `json:",omitempty"`
	AccountName  string `json:",omitempty"`
	AccountKey   string `json:",omitempty"`
	Bucket       string `json:",omitempty"`
	Prefix       string `json:",omitempty"`
	Region       string `json:",omitempty"`
	StorageClass string `json:",omitempty"`
}

TierAzure represents the remote tier configuration for Azure Blob Storage.

func (*TierAzure) DecodeMsg

func (z *TierAzure) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*TierAzure) EncodeMsg

func (z *TierAzure) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*TierAzure) MarshalMsg

func (z *TierAzure) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*TierAzure) Msgsize

func (z *TierAzure) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*TierAzure) UnmarshalMsg

func (z *TierAzure) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type TierConfig

type TierConfig struct {
	Version string
	Type    TierType   `json:",omitempty"`
	Name    string     `json:",omitempty"`
	S3      *TierS3    `json:",omitempty"`
	Azure   *TierAzure `json:",omitempty"`
	GCS     *TierGCS   `json:",omitempty"`
	MinIO   *TierMinIO `json:",omitempty"`
}

TierConfig represents the different remote tier backend configurations supported. The specific backend is identified by the Type field. It has a Version field to allow for backwards-compatible extension in the future.

func NewTierAzure

func NewTierAzure(name, accountName, accountKey, bucket string, options ...AzureOptions) (*TierConfig, error)

NewTierAzure returns a TierConfig of Azure type. Returns error if the given parameters are invalid like name is empty etc.

Example
simpleAzSC, err := NewTierAzure("simple-az", "accessKey", "secretKey", "testbucket")
if err != nil {
	log.Fatalln(err, "Failed to create azure backed tier")
}
fmt.Println(simpleAzSC)

fullyCustomAzSC, err := NewTierAzure("custom-az", "accessKey", "secretKey", "testbucket", AzureEndpoint("http://blob.core.windows.net"), AzurePrefix("testprefix"))
if err != nil {
	log.Fatalln(err, "Failed to create azure backed tier")
}
fmt.Println(fullyCustomAzSC)
Output:

func NewTierGCS

func NewTierGCS(name string, credsJSON []byte, bucket string, options ...GCSOptions) (*TierConfig, error)

NewTierGCS returns a TierConfig of GCS type. Returns error if the given parameters are invalid like name is empty etc.

Example
credsJSON := []byte("credentials json content goes here")
simpleGCSSC, err := NewTierGCS("simple-gcs", credsJSON, "testbucket")
if err != nil {
	log.Fatalln(err, "Failed to create GCS backed tier")
}
fmt.Println(simpleGCSSC)

fullyCustomGCSSC, err := NewTierGCS("custom-gcs", credsJSON, "testbucket", GCSPrefix("testprefix"))
if err != nil {
	log.Fatalln(err, "Failed to create GCS backed tier")
}
fmt.Println(fullyCustomGCSSC)
Output:

func NewTierMinIO

func NewTierMinIO(name, endpoint, accessKey, secretKey, bucket string, options ...MinIOOptions) (*TierConfig, error)

func NewTierS3

func NewTierS3(name, accessKey, secretKey, bucket string, options ...S3Options) (*TierConfig, error)

NewTierS3 returns a TierConfig of S3 type. Returns error if the given parameters are invalid like name is empty etc.

Example
simpleS3SC, err := NewTierS3("simple-s3", "accessKey", "secretKey", "testbucket")
if err != nil {
	log.Fatalln(err, "Failed to create s3 backed tier")
}
fmt.Println(simpleS3SC)

fullyCustomS3SC, err := NewTierS3("custom-s3", "accessKey", "secretKey", "testbucket",
	S3Endpoint("https://s3.amazonaws.com"), S3Prefix("testprefix"), S3Region("us-west-1"), S3StorageClass("S3_IA"))
if err != nil {
	log.Fatalln(err, "Failed to create s3 tier")
}
fmt.Println(fullyCustomS3SC)
Output:

func (*TierConfig) Bucket

func (cfg *TierConfig) Bucket() string

Bucket returns the remote tier backend bucket.

func (*TierConfig) Clone

func (cfg *TierConfig) Clone() TierConfig

Clone returns a copy of TierConfig with secret key/credentials redacted.

func (*TierConfig) DecodeMsg

func (z *TierConfig) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*TierConfig) EncodeMsg

func (z *TierConfig) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*TierConfig) Endpoint

func (cfg *TierConfig) Endpoint() string

Endpoint returns the remote tier backend endpoint.

func (*TierConfig) MarshalMsg

func (z *TierConfig) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*TierConfig) Msgsize

func (z *TierConfig) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*TierConfig) Prefix

func (cfg *TierConfig) Prefix() string

Prefix returns the remote tier backend prefix.

func (*TierConfig) Region

func (cfg *TierConfig) Region() string

Region returns the remote tier backend region.

func (*TierConfig) UnmarshalJSON

func (cfg *TierConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals json value to ensure that Type field is filled in correspondence with the tier config supplied. See TestUnmarshalTierConfig for an example json.

func (*TierConfig) UnmarshalMsg

func (z *TierConfig) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type TierCreds

type TierCreds struct {
	AccessKey string `json:"access,omitempty"`
	SecretKey string `json:"secret,omitempty"`
	CredsJSON []byte `json:"creds,omitempty"`
	AWSRole   bool   `json:"awsrole"`
}

TierCreds is used to pass remote tier credentials in a tier-edit operation.

type TierGCS

type TierGCS struct {
	Endpoint     string `json:",omitempty"` // custom endpoint is not supported for GCS
	Creds        string `json:",omitempty"` // base64 encoding of credentials.json
	Bucket       string `json:",omitempty"`
	Prefix       string `json:",omitempty"`
	Region       string `json:",omitempty"`
	StorageClass string `json:",omitempty"`
}

TierGCS represents the remote tier configuration for Google Cloud Storage

func (*TierGCS) DecodeMsg

func (z *TierGCS) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*TierGCS) EncodeMsg

func (z *TierGCS) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*TierGCS) GetCredentialJSON

func (gcs *TierGCS) GetCredentialJSON() ([]byte, error)

GetCredentialJSON method returns the credentials JSON bytes.

func (*TierGCS) MarshalMsg

func (z *TierGCS) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*TierGCS) Msgsize

func (z *TierGCS) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*TierGCS) UnmarshalMsg

func (z *TierGCS) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type TierInfo

type TierInfo struct {
	Name       string
	Type       string
	Stats      TierStats
	DailyStats DailyTierStats
}

TierInfo contains tier name, type and statistics

type TierMinIO

type TierMinIO struct {
	Endpoint  string `json:",omitempty"`
	AccessKey string `json:",omitempty"`
	SecretKey string `json:",omitempty"`
	Bucket    string `json:",omitempty"`
	Prefix    string `json:",omitempty"`
	Region    string `json:",omitempty"`
}

TierMinIO represents the remote tier configuration for MinIO object storage backend.

func (*TierMinIO) DecodeMsg

func (z *TierMinIO) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*TierMinIO) EncodeMsg

func (z *TierMinIO) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*TierMinIO) MarshalMsg

func (z *TierMinIO) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*TierMinIO) Msgsize

func (z *TierMinIO) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*TierMinIO) UnmarshalMsg

func (z *TierMinIO) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type TierS3

type TierS3 struct {
	Endpoint     string `json:",omitempty"`
	AccessKey    string `json:",omitempty"`
	SecretKey    string `json:",omitempty"`
	Bucket       string `json:",omitempty"`
	Prefix       string `json:",omitempty"`
	Region       string `json:",omitempty"`
	StorageClass string `json:",omitempty"`
	AWSRole      bool   `json:",omitempty"`
}

TierS3 represents the remote tier configuration for AWS S3 compatible backend.

func (*TierS3) DecodeMsg

func (z *TierS3) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*TierS3) EncodeMsg

func (z *TierS3) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*TierS3) MarshalMsg

func (z *TierS3) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*TierS3) Msgsize

func (z *TierS3) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*TierS3) UnmarshalMsg

func (z *TierS3) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type TierStats

type TierStats struct {
	TotalSize   uint64 `json:"totalSize"`
	NumVersions int    `json:"numVersions"`
	NumObjects  int    `json:"numObjects"`
}

TierStats contains per-tier statistics like total size, number of objects/versions transitioned, etc.

type TierType

type TierType int

TierType enumerates different remote tier backends.

const (
	// Unsupported refers to remote tier backend that is not supported in this version
	Unsupported TierType = iota
	// S3 refers to AWS S3 compatible backend
	S3
	// Azure refers to Azure Blob Storage
	Azure
	// GCS refers to Google Cloud Storage
	GCS
	// MinIO refers to MinIO object storage backend
	MinIO
)

func NewTierType

func NewTierType(scType string) (TierType, error)

NewTierType creates TierType if scType is a valid tier type string, otherwise returns an error.

func (*TierType) DecodeMsg

func (z *TierType) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (TierType) EncodeMsg

func (z TierType) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (TierType) MarshalJSON

func (tt TierType) MarshalJSON() ([]byte, error)

MarshalJSON returns the canonical json representation of tt.

func (TierType) MarshalMsg

func (z TierType) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (TierType) Msgsize

func (z TierType) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (TierType) String

func (tt TierType) String() string

String returns the name of tt's remote tier backend.

func (*TierType) UnmarshalJSON

func (tt *TierType) UnmarshalJSON(data []byte) error

UnmarshalJSON parses the provided tier type string, failing unmarshal if data contains invalid tier type.

func (*TierType) UnmarshalMsg

func (z *TierType) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type TimeDurations

type TimeDurations []time.Duration

TimeDurations is time.Duration segments.

func (TimeDurations) Len

func (ts TimeDurations) Len() int

func (TimeDurations) Measure

func (ts TimeDurations) Measure() Timings

Measure - calculate all the latency measurements

type TimeInfo

type TimeInfo struct {
	CurrentTime       time.Time `json:"current_time"`
	RoundtripDuration int32     `json:"roundtrip_duration"`
}

TimeInfo contains current time in UTC, and the roundtrip duration when fetching it remotely

type TimedAction

type TimedAction struct {
	Count   uint64 `json:"count"`
	AccTime uint64 `json:"acc_time_ns"`
	Bytes   uint64 `json:"bytes,omitempty"`
}

TimedAction contains a number of actions and their accumulated duration in nanoseconds.

func (TimedAction) Avg

func (t TimedAction) Avg() time.Duration

Avg returns the average time spent on the action.

func (TimedAction) AvgBytes

func (t TimedAction) AvgBytes() uint64

AvgBytes returns the average time spent on the action.

func (*TimedAction) Merge

func (t *TimedAction) Merge(other TimedAction)

Merge other into t.

type Timings

type Timings struct {
	Avg     time.Duration `json:"avg"`   // Average duration per sample
	P50     time.Duration `json:"p50"`   // 50th %ile of all the sample durations
	P75     time.Duration `json:"p75"`   // 75th %ile of all the sample durations
	P95     time.Duration `json:"p95"`   // 95th %ile of all the sample durations
	P99     time.Duration `json:"p99"`   // 99th %ile of all the sample durations
	P999    time.Duration `json:"p999"`  // 99.9th %ile of all the sample durations
	Long5p  time.Duration `json:"l5p"`   // Average duration of the longest 5%
	Short5p time.Duration `json:"s5p"`   // Average duration of the shortest 5%
	Max     time.Duration `json:"max"`   // Max duration
	Min     time.Duration `json:"min"`   // Min duration
	StdDev  time.Duration `json:"sdev"`  // Standard deviation among all the sample durations
	Range   time.Duration `json:"range"` // Delta between Max and Min
}

Timings captures all latency metrics

type TopLockOpts

type TopLockOpts struct {
	Count int
	Stale bool
}

TopLockOpts top lock options

type TraceCallStats

type TraceCallStats struct {
	InputBytes  int `json:"inputbytes"`
	OutputBytes int `json:"outputbytes"`
	// Deprecated: Use TraceInfo.Duration (June 2022)
	Latency         time.Duration `json:"latency"`
	TimeToFirstByte time.Duration `json:"timetofirstbyte"`
}

TraceCallStats records request stats

type TraceHTTPStats

type TraceHTTPStats struct {
	ReqInfo   TraceRequestInfo  `json:"request"`
	RespInfo  TraceResponseInfo `json:"response"`
	CallStats TraceCallStats    `json:"stats"`
}

type TraceInfo

type TraceInfo struct {
	TraceType TraceType `json:"type"`

	NodeName string        `json:"nodename"`
	FuncName string        `json:"funcname"`
	Time     time.Time     `json:"time"`
	Path     string        `json:"path"`
	Duration time.Duration `json:"dur"`

	Message    string          `json:"msg,omitempty"`
	Error      string          `json:"error,omitempty"`
	HTTP       *TraceHTTPStats `json:"http,omitempty"`
	HealResult *HealResultItem `json:"healResult,omitempty"`
}

TraceInfo - represents a trace record, additionally also reports errors if any while listening on trace.

func (TraceInfo) Mask

func (t TraceInfo) Mask() uint64

Mask returns the trace type as uint32.

type TraceRequestInfo

type TraceRequestInfo struct {
	Time     time.Time   `json:"time"`
	Proto    string      `json:"proto"`
	Method   string      `json:"method"`
	Path     string      `json:"path,omitempty"`
	RawQuery string      `json:"rawquery,omitempty"`
	Headers  http.Header `json:"headers,omitempty"`
	Body     []byte      `json:"body,omitempty"`
	Client   string      `json:"client"`
}

TraceRequestInfo represents trace of http request

type TraceResponseInfo

type TraceResponseInfo struct {
	Time       time.Time   `json:"time"`
	Headers    http.Header `json:"headers,omitempty"`
	Body       []byte      `json:"body,omitempty"`
	StatusCode int         `json:"statuscode,omitempty"`
}

TraceResponseInfo represents trace of http request

type TraceType

type TraceType uint64

TraceType indicates the type of the tracing Info

const (
	// TraceOS tracing (Golang os package calls)
	TraceOS TraceType = 1 << iota
	// TraceStorage tracing (MinIO Storage Layer)
	TraceStorage
	// TraceS3 provides tracing of S3 API calls
	TraceS3
	// TraceInternal tracing internal (.minio.sys/...) HTTP calls
	TraceInternal
	// TraceScanner will trace scan operations.
	TraceScanner
	// TraceDecommission will trace decommission operations.
	TraceDecommission
	// TraceHealing will trace healing operations.
	TraceHealing

	// TraceAll contains all valid trace modes.
	// This *must* be the last entry.
	TraceAll TraceType = (1 << iota) - 1
)

func (TraceType) Contains

func (t TraceType) Contains(other TraceType) bool

Contains returns whether all flags in other is present in t.

func (TraceType) Mask

func (t TraceType) Mask() uint64

Mask returns the trace type as uint32.

func (*TraceType) Merge

func (t *TraceType) Merge(other TraceType)

Merge will merge other into t.

func (TraceType) Overlaps

func (t TraceType) Overlaps(other TraceType) bool

Overlaps returns whether any flags in t overlaps with other.

func (*TraceType) SetIf

func (t *TraceType) SetIf(b bool, other TraceType)

SetIf will add other if b is true.

func (TraceType) SingleType

func (t TraceType) SingleType() bool

SingleType returns whether t has a single type set.

func (TraceType) String

func (i TraceType) String() string

type UpdateServiceAccountReq

type UpdateServiceAccountReq struct {
	NewPolicy    json.RawMessage `json:"newPolicy,omitempty"` // Parsed policy from iam/policy.Parse
	NewSecretKey string          `json:"newSecretKey,omitempty"`
	NewStatus    string          `json:"newStatus,omitempty"`
}

UpdateServiceAccountReq is the request options of the edit service account admin call

type Usage

type Usage struct {
	Size  uint64 `json:"size"`
	Error string `json:"error,omitempty"`
}

Usage contains the total size used

type UserInfo

type UserInfo struct {
	SecretKey  string        `json:"secretKey,omitempty"`
	PolicyName string        `json:"policyName,omitempty"`
	Status     AccountStatus `json:"status"`
	MemberOf   []string      `json:"memberOf,omitempty"`
	UpdatedAt  time.Time     `json:"updatedAt,omitempty"`
}

UserInfo carries information about long term users.

type Versions

type Versions struct {
	Count uint64 `json:"count"`
	Error string `json:"error,omitempty"`
}

Versions contains the number of versions

Directories

Path Synopsis
Package cgroup implements parsing for all the cgroup categories and functionality in a simple way.
Package cgroup implements parsing for all the cgroup categories and functionality in a simple way.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL