madmin

package module
v3.0.50 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: AGPL-3.0 Imports: 65 Imported by: 47

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/minio/madmin-go/v3"
)

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

All versions of this SDK starting from v2.0.0 are distributed under the GNU AGPLv3 license that can be found in the LICENSE file.

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"
	SRIAMItemPolicyMapping = "policy-mapping"
	SRIAMItemGroupInfo     = "group-info"
	SRIAMItemCredential    = "credential"
	SRIAMItemSvcAcc        = "service-account"
	SRIAMItemSTSAcc        = "sts-account"
	SRIAMItemIAMUser       = "iam-user"
)

SRIAMItem.Type constants.

View Source
const (
	SRBucketMetaTypePolicy           = "policy"
	SRBucketMetaTypeTags             = "tags"
	SRBucketMetaTypeVersionConfig    = "version-config"
	SRBucketMetaTypeObjectLockConfig = "object-lock-config"
	SRBucketMetaTypeSSEConfig        = "sse-config"
	SRBucketMetaTypeQuotaConfig      = "quota-config"
	SRBucketMetaLCConfig             = "lc-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 (
	OpenidIDPCfg string = "openid"
	LDAPIDPCfg   string = "ldap"
)

Constants for IDP configuration types.

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"
	BatchSubSys          = "batch"
	DriveSubSys          = "drive"
	ILMSubsys            = "ilm"

	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"

	LambdaWebhookSubSys = "lambda_webhook"

	BrowserSubSys = "browser"
)

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 (
	// MaxClientPerfTimeout for max time out for client perf
	MaxClientPerfTimeout = time.Second * 30
	// MinClientPerfTimeout for min time out for client perf
	MinClientPerfTimeout = time.Second * 5
)
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 BatchJobExpireTemplate = `` /* 1992-byte string literal not displayed */

BatchJobExpireTemplate provides a sample template for batch expiring objects

View Source
const BatchJobKeyRotateTemplate = `` /* 1310-byte string literal not displayed */

BatchJobKeyRotateTemplate provides a sample template for batch key rotation

View Source
const BatchJobReplicateTemplate = `` /* 3237-byte string literal not displayed */

BatchJobReplicateTemplate provides a sample template for batch replication

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 SiteReplAPIVersion = "1"

SiteReplAPIVersion holds the supported version of the server Replication API

View Source
const TierConfigVer = "v1"

TierConfigVer refers to the current tier config version

View Source
const (
	// TraceBatch will trace all batch operations.
	TraceBatch = TraceBatchReplication | TraceBatchKeyRotation | TraceBatchExpire // |TraceBatch<NextFeature>
)

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.

View Source
var ErrUnexpectedHeader = errors.New("unexpected header")

ErrUnexpectedHeader indicates that the data stream returned unexpected header

HealthDataTypesList - List of health datatypes

View Source
var HealthDataTypesMap = map[string]HealthDataType{
	"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

SupportedJobTypes supported job types

View Source
var ValidIDPConfigTypes = set.CreateStringSet(OpenidIDPCfg, LDAPIDPCfg)

ValidIDPConfigTypes - set of valid IDP configs.

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 AzureServicePrincipal added in v3.0.37

func AzureServicePrincipal(tenantID, clientID, clientSecret string) func(az *TierAzure) error

AzureServicePrincipal helper to supply optional service principal credentials

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 ParsePrometheusResults added in v3.0.40

func ParsePrometheusResults(reader io.Reader) (results []*prom2json.Family, err error)

func S3AWSRole

func S3AWSRole() func(s3 *TierS3) error

S3AWSRole helper to use optional AWS Role to NewTierS3

func S3AWSRoleARN added in v3.0.34

func S3AWSRoleARN(roleARN string) func(s3 *TierS3) error

S3AWSRoleARN helper to use optional AWS RoleARN to NewTierS3

func S3AWSRoleDurationSeconds added in v3.0.34

func S3AWSRoleDurationSeconds(dsecs int) func(s3 *TierS3) error

S3AWSRoleDurationSeconds helper to use optional token duration to NewTierS3

func S3AWSRoleSessionName added in v3.0.34

func S3AWSRoleSessionName(roleSessionName string) func(s3 *TierS3) error

S3AWSRoleSessionName helper to use optional AWS RoleSessionName to NewTierS3

func S3AWSRoleWebIdentityTokenFile added in v3.0.34

func S3AWSRoleWebIdentityTokenFile(tokenFile string) func(s3 *TierS3) error

S3AWSRoleWebIdentityTokenFile helper to use optional AWS Role token file 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.

func WithDriveMetrics added in v3.0.46

func WithDriveMetrics(metrics bool) func(*ServerInfoOpts)

WithDriveMetrics asks server to return additional metrics per drive

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"`
	Policy    string        `json:"policy,omitempty"`
	Status    AccountStatus `json:"status"`
}

AddOrUpdateUserReq allows to update

  • user details such as secret key
  • account status.
  • optionally a comma separated list of policies to be applied for the user.

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"`

	// Name for this access key
	Name string `json:"name,omitempty"`
	// Description for this access key
	Description string `json:"description,omitempty"`
	// Time at which this access key expires
	Expiration *time.Time `json:"expiration,omitempty"`

	// Deprecated: use description instead
	Comment string `json:"comment,omitempty"`
}

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

func (*AddServiceAccountReq) Validate

func (r *AddServiceAccountReq) Validate() error

Validate validates the request parameters.

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 Deprecated: please use NewWithOptions

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) AddOrUpdateIDPConfig

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

AddOrUpdateIDPConfig - creates a new or updates an existing IDP configuration on the server.

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) AddServiceAccountLDAP added in v3.0.30

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

AddServiceAccountLDAP - AddServiceAccount with extra features, restricted to LDAP users.

func (*AdminClient) AddTier

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

AddTier adds a new remote tier.

func (*AdminClient) AddTierIgnoreInUse

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

AddTierIgnoreInUse adds a new remote tier, ignoring if it's being used by another MinIO deployment.

func (*AdminClient) AddUser

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

AddUser - adds a user.

func (*AdminClient) AssignPolicy

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

AssignPolicy tries to assign a policy to an identity at the KMS connected to a MinIO server.

func (*AdminClient) AttachPolicy

AttachPolicy - attach policies to a user or group.

func (*AdminClient) AttachPolicyLDAP

func (adm *AdminClient) AttachPolicyLDAP(ctx context.Context, par PolicyAssociationReq) (PolicyAssociationResp, error)

AttachPolicyLDAP - client call to attach policies for LDAP.

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) BucketReplicationMRF added in v3.0.2

func (adm *AdminClient) BucketReplicationMRF(ctx context.Context, bucketName string, node string) <-chan ReplicationMRF

BucketReplicationMRF - gets MRF entries for bucket and node. Return MRF across buckets if bucket is empty, across nodes if node is `all`

func (*AdminClient) CancelBatchJob

func (adm *AdminClient) CancelBatchJob(ctx context.Context, jobID string) error

CancelBatchJob cancels ongoing batch job.

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) ClientPerf added in v3.0.11

func (adm *AdminClient) ClientPerf(ctx context.Context, dur time.Duration) (result ClientPerfResult, err error)

ClientPerf - perform net from client to MinIO servers

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) DeleteIdentity

func (adm *AdminClient) DeleteIdentity(ctx context.Context, identity string) error

DeleteIdentity tries to delete a identity at the KMS connected to a MinIO server.

func (*AdminClient) DeleteKey

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

DeleteKey tries to delete a key with the given keyID at the KMS connected to a MinIO server.

func (*AdminClient) DeletePolicy

func (adm *AdminClient) DeletePolicy(ctx context.Context, policy string) error

DeletePolicy tries to delete a policy at the KMS connected to a MinIO 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) DescribeBatchJob

func (adm *AdminClient) DescribeBatchJob(ctx context.Context, jobID string) (string, error)

DescribeBatchJob - describes a currently running Job.

func (*AdminClient) DescribeIdentity

func (adm *AdminClient) DescribeIdentity(ctx context.Context, identity string) (*KMSDescribeIdentity, error)

DescribeIdentity tries to describe a KMS identity

func (*AdminClient) DescribePolicy

func (adm *AdminClient) DescribePolicy(ctx context.Context, policy string) (*KMSDescribePolicy, error)

DescribePolicy tries to describe a KMS policy

func (*AdminClient) DescribeSelfIdentity

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

DescribeSelfIdentity tries to describe the identity issuing the request.

func (*AdminClient) DetachPolicy

DetachPolicy - detach policies from a user or group.

func (*AdminClient) DetachPolicyLDAP

func (adm *AdminClient) DetachPolicyLDAP(ctx context.Context, par PolicyAssociationReq) (PolicyAssociationResp, error)

DetachPolicyLDAP - client call to detach policies for LDAP.

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) GenerateBatchJob

func (adm *AdminClient) GenerateBatchJob(_ context.Context, opts GenerateBatchJobOpts) (string, error)

GenerateBatchJob creates a new job template from standard template TODO: allow configuring yaml values

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) GetLDAPPolicyEntities

func (adm *AdminClient) GetLDAPPolicyEntities(ctx context.Context,
	q PolicyEntitiesQuery,
) (r PolicyEntitiesResult, err error)

GetLDAPPolicyEntities - returns LDAP policy entities.

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) GetPolicy

func (adm *AdminClient) GetPolicy(ctx context.Context, policy string) (*KMSPolicy, error)

GetPolicy tries to get a KMS policy

func (*AdminClient) GetPolicyEntities

func (adm *AdminClient) GetPolicyEntities(ctx context.Context, q PolicyEntitiesQuery) (r PolicyEntitiesResult, err error)

GetPolicyEntities - returns builtin policy entities.

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) ImportKey

func (adm *AdminClient) ImportKey(ctx context.Context, keyID string, content []byte) error

ImportKey tries to import a cryptographic key at the KMS connected to a MinIO server.

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 []byte, c io.ReadCloser, err error)

Inspect makes an admin call to download a raw files from disk. If inspect is called with a public key no key will be returned and the data is returned encrypted with the public key.

func (*AdminClient) KMSAPIs

func (adm *AdminClient) KMSAPIs(ctx context.Context) ([]KMSAPI, error)

KMSAPIs returns a list of supported API endpoints in the KMS connected to the MinIO server, if configured.

func (*AdminClient) KMSMetrics

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

KMSMetrics returns metrics about the KMS connected to the MinIO server, if configured.

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) KMSVersion

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

KMSVersion returns a list of supported API endpoints in the KMS connected to the MinIO server, if configured.

func (*AdminClient) ListAccessKeysLDAP added in v3.0.30

func (adm *AdminClient) ListAccessKeysLDAP(ctx context.Context, userDN string, listType string) (ListAccessKeysLDAPResp, error)

ListAccessKeysLDAP - list service accounts belonging to the specified user

func (*AdminClient) ListBatchJobs

func (adm *AdminClient) ListBatchJobs(ctx context.Context, fl *ListBatchJobsFilter) (ListBatchJobsResult, error)

ListBatchJobs list all the currently active batch jobs

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) ListIdentities

func (adm *AdminClient) ListIdentities(ctx context.Context, pattern string) ([]KMSIdentityInfo, error)

ListIdentities tries to get all identities that match the specified pattern

func (*AdminClient) ListKeys

func (adm *AdminClient) ListKeys(ctx context.Context, pattern string) ([]KMSKeyInfo, error)

ListKeys tries to get all key names that match the specified pattern

func (*AdminClient) ListPolicies

func (adm *AdminClient) ListPolicies(ctx context.Context, pattern string) ([]KMSPolicyInfo, error)

ListPolicies tries to get all policies that match the specified pattern

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) RebalanceStart

func (adm *AdminClient) RebalanceStart(ctx context.Context) (id string, err error)

RebalanceStart starts a rebalance operation if one isn't in progress already

func (*AdminClient) RebalanceStatus

func (adm *AdminClient) RebalanceStatus(ctx context.Context) (r RebalanceStatus, err error)

func (*AdminClient) RebalanceStop

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

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) SRStateEdit added in v3.0.32

func (adm *AdminClient) SRStateEdit(ctx context.Context, state SRStateEditReq) error

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

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, anonymize string) (*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, options ...func(*ServerInfoOpts)) (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) ServerUpdateV2 added in v3.0.40

func (adm *AdminClient) ServerUpdateV2(ctx context.Context, opts ServerUpdateOpts) (us ServerUpdateStatusV2, err error)

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

func (*AdminClient) ServiceAction added in v3.0.40

func (adm *AdminClient) ServiceAction(ctx context.Context, opts ServiceActionOpts) (ServiceActionResult, error)

ServiceAction - specify the type of service action that we are requesting the server to perform

func (*AdminClient) ServiceFreezeV2 added in v3.0.41

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

ServiceFreezeV2 - freezes all incoming S3 API calls on MinIO cluster

func (*AdminClient) ServiceRestart

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

ServiceRestart - Deprecated: restarts the MinIO cluster

func (*AdminClient) ServiceRestartV2 added in v3.0.41

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

ServiceRestartV2 - restarts the MinIO cluster

func (*AdminClient) ServiceStop

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

ServiceStop - Deprecated: stops the MinIO cluster

func (*AdminClient) ServiceStopV2 added in v3.0.41

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

ServiceStopV2 - 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 - Deprecated: un-freezes all incoming S3 API calls on MinIO cluster

func (*AdminClient) ServiceUnfreezeV2 added in v3.0.41

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

ServiceUnfreezeV2 - 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. Deprecated: please use Options{Transport: tr} to provide 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) SetKMSPolicy

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

SetKMSPolicy tries to create or update a policy at the KMS connected to a MinIO 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) SetUserReq

func (adm *AdminClient) SetUserReq(ctx context.Context, accessKey string, req AddOrUpdateUserReq) error

SetUserReq - update user secret key, account status or policies.

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, opts SRAddOptions) (ReplicateAddStatus, error)

SiteReplicationAdd - sends the SR add API call.

func (*AdminClient) SiteReplicationEdit

func (adm *AdminClient) SiteReplicationEdit(ctx context.Context, site PeerInfo, opts SREditOptions) (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) SiteReplicationPerf added in v3.0.5

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

SiteReplicationPerf - perform site-replication on the MinIO servers

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) SiteReplicationResyncOp

func (adm *AdminClient) SiteReplicationResyncOp(ctx context.Context, site PeerInfo, op SiteResyncOp) (SRResyncOpStatus, error)

SiteReplicationResyncOp - perform a site replication resync operation

func (*AdminClient) Speedtest

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

Speedtest - perform speedtest on the MinIO servers

func (*AdminClient) StartBatchJob

func (adm *AdminClient) StartBatchJob(ctx context.Context, job string) (BatchJobResult, error)

StartBatchJob start a new batch job, input job description is in YAML.

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) TemporaryAccountInfo

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

TemporaryAccountInfo - returns the info of a temporary account

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.
	StandardSCParities []int // Parity disks per pool for currently configured Standard storage class
	RRSCData           []int // Data disks for currently configured Reduced Redundancy storage class.
	RRSCParities       []int // Parity disks per pool 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

	// Deprecated Aug 2023
	StandardSCParity int // Parity disks for currently configured Standard storage class.
	RRSCParity       int // Parity disks for currently configured Reduced Redundancy storage class.
}

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 BatchJobMetrics

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

	// Jobs by ID.
	Jobs map[string]JobMetric
}

BatchJobMetrics contains metrics for batch operations

func (*BatchJobMetrics) Merge

func (o *BatchJobMetrics) Merge(other *BatchJobMetrics)

Merge other into 'o'.

type BatchJobResult

type BatchJobResult struct {
	ID      string        `json:"id"`
	Type    BatchJobType  `json:"type"`
	User    string        `json:"user,omitempty"`
	Started time.Time     `json:"started"`
	Elapsed time.Duration `json:"elapsed,omitempty"`
}

BatchJobResult returned by StartBatchJob

type BatchJobType

type BatchJobType string

BatchJobType type to describe batch job types

const (
	BatchJobReplicate BatchJobType = "replicate"
	BatchJobKeyRotate BatchJobType = "keyrotate"
	BatchJobExpire    BatchJobType = "expire"
)

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"`
	ObjectVersionsHistogram map[string]uint64 `json:"objectsVersionsHistogram"`
	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 BucketBandwidth added in v3.0.20

type BucketBandwidth struct {
	Limit     uint64    `json:"bandwidthLimitPerBucket"`
	IsSet     bool      `json:"set"`
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

BucketBandwidth has default bandwidth limit per bucket in bytes/sec

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"`    // Deprecated Aug 2023
	Size     uint64    `json:"size"`     // Indicates maximum size allowed per bucket
	Rate     uint64    `json:"rate"`     // Indicates bandwidth rate allocated per bucket
	Requests uint64    `json:"requests"` // Indicates number of requests allocated per bucket
	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:"region,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"`
	TotalDowntime       time.Duration `json:"totalDowntime"`
	LastOnline          time.Time     `json:"lastOnline"`
	Online              bool          `json:"isOnline"`
	Latency             LatencyStat   `json:"latency"`
	DeploymentID        string        `json:"deploymentID,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"`
	DeleteMarkersCount      uint64            `json:"deleteMarkersCount"`
	ObjectSizesHistogram    map[string]uint64 `json:"objectsSizesHistogram"`
	ObjectVersionsHistogram map[string]uint64 `json:"objectsVersionsHistogram"`
}

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 CPUFreqStats

type CPUFreqStats struct {
	Name                     string
	CpuinfoCurrentFrequency  *uint64
	CpuinfoMinimumFrequency  *uint64
	CpuinfoMaximumFrequency  *uint64
	CpuinfoTransitionLatency *uint64
	ScalingCurrentFrequency  *uint64
	ScalingMinimumFrequency  *uint64
	ScalingMaximumFrequency  *uint64
	AvailableGovernors       string
	Driver                   string
	Governor                 string
	RelatedCpus              string
	SetSpeed                 string
}

CPUFreqStats CPU frequency stats

type CPUMetrics added in v3.0.19

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

	TimesStat *cpu.TimesStat `json:"timesStat"`
	LoadStat  *load.AvgStat  `json:"loadStat"`
	CPUCount  int            `json:"cpuCount"`
}

func (*CPUMetrics) Merge added in v3.0.19

func (m *CPUMetrics) Merge(other *CPUMetrics)

Merge other into 'm'.

type CPUs

type CPUs struct {
	NodeCommon

	CPUs         []CPU          `json:"cpus,omitempty"`
	CPUFreqStats []CPUFreqStats `json:"freq_stats,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 ClientPerfExtraTime added in v3.0.11

type ClientPerfExtraTime struct {
	TimeSpent int64 `json:"dur,omitempty"`
}

ClientPerfExtraTime - time for get lock or other

type ClientPerfResult added in v3.0.11

type ClientPerfResult struct {
	Endpoint  string `json:"endpoint,omitempty"`
	Error     string `json:"error,omitempty"`
	BytesSend uint64
	TimeSpent int64
}

ClientPerfResult - stats from client to server

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"`

	// Server capacity related data
	TotalCapacity     uint64 `json:"capacity"`
	TotalFreeCapacity uint64 `json:"freeCapacity"`
	TotalUsedCapacity uint64 `json:"usedCapacity"`
}

DataUsageInfo represents data usage stats of the underlying Object API

type DeleteMarkers added in v3.0.8

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

DeleteMarkers contains the number of delete markers

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"`
}

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"`
	UsedInodes      uint64       `json:"used_inodes"`
	FreeInodes      uint64       `json:"free_inodes,omitempty"`
	Local           bool         `json:"local,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"`

	// TotalTokens set per drive max concurrent I/O.
	TotalTokens uint32 `json:"totalTokens,omitempty"`
	// TotalWaiting the amount of concurrent I/O waiting on disk
	TotalWaiting uint32 `json:"totalWaiting,omitempty"`

	// Captures all data availability errors such as
	// permission denied, faulty disk and timeout errors.
	TotalErrorsAvailability uint64 `json:"totalErrorsAvailability,omitempty"`
	// Captures all timeout only errors
	TotalErrorsTimeout uint64 `json:"totalErrorsTimeout,omitempty"`

	// Total writes on disk (could be empty if the feature
	// is not enabled on the server)
	TotalWrites uint64 `json:"totalWrites,omitempty"`
	// Total deletes on disk (could be empty if the feature
	// is not enabled on the server)
	TotalDeletes uint64 `json:"totalDeletes,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"`
	OnlineDisks  int         `json:"onlineDisks"`
	OfflineDisks int         `json:"offlineDisks"`
	// Parity disks for currently configured Standard storage class.
	StandardSCParity int `json:"standardSCParity"`
	// Parity disks for currently configured Reduced Redundancy storage class.
	RRSCParity int `json:"rrSCParity"`

	// Per pool information
	TotalSets    []int `json:"totalSets"`
	DrivesPerSet []int `json:"totalDrivesPerSet"`
}

ErasureBackend contains specific erasure storage information

type ErasureSetInfo

type ErasureSetInfo struct {
	ID                 int    `json:"id"`
	RawUsage           uint64 `json:"rawUsage"`
	RawCapacity        uint64 `json:"rawCapacity"`
	Usage              uint64 `json:"usage"`
	ObjectsCount       uint64 `json:"objectsCount"`
	VersionsCount      uint64 `json:"versionsCount"`
	DeleteMarkersCount uint64 `json:"deleteMarkersCount"`
	HealDisks          int    `json:"healDisks"`
}

ErasureSetInfo provides information per erasure set

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/minio/madmin-go/v3"
...
...
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 ExpirationInfo added in v3.0.11

type ExpirationInfo struct {
	// Last bucket/object key rotated
	Bucket string `json:"lastBucket"`
	Object string `json:"lastObject"`

	// Verbose information
	Objects       int64 `json:"objects"`
	ObjectsFailed int64 `json:"objectsFailed"`
}

type FSBackend

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

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 GenerateBatchJobOpts

type GenerateBatchJobOpts struct {
	Type BatchJobType
}

GenerateBatchJobOpts is to be implemented in future.

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 GroupPolicyEntities

type GroupPolicyEntities struct {
	Group    string   `json:"group"`
	Policies []string `json:"policies"`
}

GroupPolicyEntities - group -> policies mapping

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"`
	UpdateParity bool         `json:"updateParity"` // Update the parity of the existing object with a new one
	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"`
	HealID     string    `json:"heal_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"`
	ItemsSkipped uint64 `json:"items_skipped"`
	BytesDone    uint64 `json:"bytes_done"`
	BytesFailed  uint64 `json:"bytes_failed"`
	BytesSkipped uint64 `json:"bytes_skipped"`

	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 (
	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"`
	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 ILMExpiryRule added in v3.0.28

type ILMExpiryRule struct {
	ILMRule   string    `json:"ilm-rule"`
	Bucket    string    `json:"bucket"`
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

ILMExpiryRule - represents an ILM expiry rule

type InQueueMetric added in v3.0.12

type InQueueMetric struct {
	Curr QStat `json:"curr" msg:"cq"`
	Avg  QStat `json:"avg" msg:"aq"`
	Max  QStat `json:"max" msg:"pq"`
}

InQueueMetric holds stats for objects in replication queue

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"`
	DeleteMarkers DeleteMarkers      `json:"deletemarkers,omitempty"`
	Usage         Usage              `json:"usage,omitempty"`
	Services      Services           `json:"services,omitempty"`
	Backend       ErasureBackend     `json:"backend,omitempty"`
	Servers       []ServerProperties `json:"servers,omitempty"`

	Pools map[int]map[int]ErasureSetInfo `json:"pools,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"`
	Name          string     `json:"name,omitempty"`
	Description   string     `json:"description,omitempty"`
	Expiration    *time.Time `json:"expiration,omitempty"`
}

InfoServiceAccountResp is the response body of the info service account call

type InspectOptions

type InspectOptions struct {
	Volume, File string
	PublicKey    []byte // PublicKey to use for inspected data.
}

InspectOptions provides options to Inspect.

type ItemState

type ItemState string

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

type JobMetric

type JobMetric struct {
	JobID         string    `json:"jobID"`
	JobType       string    `json:"jobType"`
	StartTime     time.Time `json:"startTime"`
	LastUpdate    time.Time `json:"lastUpdate"`
	RetryAttempts int       `json:"retryAttempts"`

	Complete bool `json:"complete"`
	Failed   bool `json:"failed"`

	// Specific job type data:
	Replicate *ReplicateInfo   `json:"replicate,omitempty"`
	KeyRotate *KeyRotationInfo `json:"rotation,omitempty"`
	Expired   *ExpirationInfo  `json:"expired,omitempty"`
}

type KMS

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

KMS contains KMS status information

type KMSAPI

type KMSAPI struct {
	Method  string
	Path    string
	MaxBody int64
	Timeout int64
}

type KMSDescribeIdentity

type KMSDescribeIdentity struct {
	Policy    string `json:"policy"`
	Identity  string `json:"identity"`
	IsAdmin   bool   `json:"isAdmin"`
	CreatedAt string `json:"createdAt"`
	CreatedBy string `json:"createdBy"`
}

KMSDescribeIdentity contains identity metadata

type KMSDescribePolicy

type KMSDescribePolicy struct {
	Name      string `json:"name"`
	CreatedAt string `json:"created_at"`
	CreatedBy string `json:"created_by"`
}

KMSDescribePolicy contains policy metadata

type KMSDescribeSelfIdentity

type KMSDescribeSelfIdentity struct {
	Policy     *KMSPolicy `json:"policy"`
	PolicyName string     `json:"policyName"`
	Identity   string     `json:"identity"`
	IsAdmin    bool       `json:"isAdmin"`
	CreatedAt  string     `json:"createdAt"`
	CreatedBy  string     `json:"createdBy"`
}

KMSDescribeSelfIdentity describes the identity issuing the request

type KMSIdentityInfo

type KMSIdentityInfo struct {
	CreatedAt string `json:"createdAt"`
	CreatedBy string `json:"createdBy"`
	Identity  string `json:"identity"`
	Policy    string `json:"policy"`
	Error     string `json:"error"`
}

KMSIdentityInfo contains policy metadata

type KMSKeyInfo

type KMSKeyInfo struct {
	CreatedAt string `json:"createdAt"`
	CreatedBy string `json:"createdBy"`
	Name      string `json:"name"`
}

KMSKeyInfo contains key metadata

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 KMSMetrics

type KMSMetrics struct {
	RequestOK     int64 `json:"kes_http_request_success"`
	RequestErr    int64 `json:"kes_http_request_error"`
	RequestFail   int64 `json:"kes_http_request_failure"`
	RequestActive int64 `json:"kes_http_request_active"`

	AuditEvents int64 `json:"kes_log_audit_events"`
	ErrorEvents int64 `json:"kes_log_error_events"`

	LatencyHistogram map[int64]int64 `json:"kes_http_response_time"`

	UpTime     int64 `json:"kes_system_up_time"`
	CPUs       int64 `json:"kes_system_num_cpu"`
	UsableCPUs int64 `json:"kes_system_num_cpu_used"`

	Threads     int64 `json:"kes_system_num_threads"`
	HeapAlloc   int64 `json:"kes_system_mem_heap_used"`
	HeapObjects int64 `json:"kes_system_mem_heap_objects"`
	StackAlloc  int64 `json:"kes_system_mem_stack_used"`
}

type KMSPolicy

type KMSPolicy struct {
	Allow []string `json:"allow"`
	Deny  []string `json:"deny"`
}

KMSPolicy represents a KMS policy

type KMSPolicyInfo

type KMSPolicyInfo struct {
	CreatedAt string `json:"created_at"`
	CreatedBy string `json:"created_by"`
	Name      string `json:"name"`
}

KMSPolicyInfo contains policy metadata

type KMSState

type KMSState struct {
	Version           string
	KeyStoreLatency   time.Duration
	KeyStoreReachable bool
	KeystoreAvailable bool

	OS         string
	Arch       string
	UpTime     time.Duration
	CPUs       int
	UsableCPUs int
	HeapAlloc  uint64
	StackAlloc uint64
}

KMSState is a KES server status snapshot.

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)
	State        KMSState             `json:"state"`          // Current KMS server state
}

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

type KMSVersion

type KMSVersion struct {
	Version string `json:"version"`
}

type KVOptions

type KVOptions struct {
	Env bool
}

KVOptions takes specific inputs for KV functions

type KeyRotationInfo

type KeyRotationInfo struct {
	// Last bucket/object key rotated
	Bucket string `json:"lastBucket"`
	Object string `json:"lastObject"`

	// Verbose information
	Objects       int64 `json:"objects"`
	ObjectsFailed int64 `json:"objectsFailed"`
}

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 LatencyStat added in v3.0.12

type LatencyStat struct {
	Curr time.Duration `json:"curr"`
	Avg  time.Duration `json:"avg"`
	Max  time.Duration `json:"max"`
}

LatencyStat represents replication link latency statistics

func (*LatencyStat) DecodeMsg added in v3.0.12

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

DecodeMsg implements msgp.Decodable

func (LatencyStat) EncodeMsg added in v3.0.12

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

EncodeMsg implements msgp.Encodable

func (LatencyStat) MarshalMsg added in v3.0.12

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

MarshalMsg implements msgp.Marshaler

func (LatencyStat) Msgsize added in v3.0.12

func (z LatencyStat) Msgsize() (s int)

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

func (*LatencyStat) UnmarshalMsg added in v3.0.12

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

UnmarshalMsg implements msgp.Unmarshaler

type ListAccessKeysLDAPResp added in v3.0.30

type ListAccessKeysLDAPResp struct {
	ServiceAccounts []ServiceAccountInfo `json:"serviceAccounts"`
	STSKeys         []ServiceAccountInfo `json:"stsKeys"`
}

ListAccessKeysLDAPResp is the response body of the list service accounts call

type ListBatchJobsFilter

type ListBatchJobsFilter struct {
	ByJobType string
}

ListBatchJobsFilter returns list based on following filtering params.

type ListBatchJobsResult

type ListBatchJobsResult struct {
	Jobs []BatchJobResult `json:"jobs"`
}

ListBatchJobsResult contains entries for all current jobs.

type ListServiceAccountsResp

type ListServiceAccountsResp struct {
	Accounts []ServiceAccountInfo `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
	Elapsed    time.Duration `json:"elapsed"`    // Duration for which lock has been held
	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 log type
	LogKindMinio LogKind = "MINIO" // Deprecated Jan 2024
	// LogKindApplication - Application log type
	LogKindApplication LogKind = "APPLICATION" // Deprecated Jan 2024
	// LogKindAll - all logs type
	LogKindAll LogKind = "ALL" // Deprecated Jan 2024

	LogKindFatal   LogKind = "FATAL"
	LogKindWarning LogKind = "WARNING"
	LogKindError   LogKind = "ERROR"
	LogKindEvent   LogKind = "EVENT"
	LogKindInfo    LogKind = "INFO"
)

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 - mask for MinIO type log
	LogMaskMinIO LogMask = 1 << iota // Deprecated Jan 2024
	// LogMaskApplication - mask for MinIO type log
	LogMaskApplication // Deprecated Jan 2024

	LogMaskFatal
	LogMaskWarning
	LogMaskError
	LogMaskEvent
	LogMaskInfo

	// 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"`
}

MRFStatus exposes MRF metrics of a server

type MemInfo

type MemInfo struct {
	NodeCommon

	Total          uint64 `json:"total,omitempty"`
	Used           uint64 `json:"used,omitempty"`
	Free           uint64 `json:"free,omitempty"`
	Available      uint64 `json:"available,omitempty"`
	Shared         uint64 `json:"shared,omitempty"`
	Cache          uint64 `json:"cache,omitempty"`
	Buffers        uint64 `json:"buffer,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 MemMetrics added in v3.0.19

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

	Info MemInfo `json:"memInfo"`
}

func (*MemMetrics) Merge added in v3.0.19

func (m *MemMetrics) Merge(other *MemMetrics)

Merge other into 'm'.

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
	MetricsBatchJobs
	MetricsSiteResync
	MetricNet
	MetricsMem
	MetricsCPU

	// 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"`
	BatchJobs  *BatchJobMetrics   `json:"batchJobs,omitempty"`
	SiteResync *SiteResyncMetrics `json:"siteResync,omitempty"`
	Net        *NetMetrics        `json:"net,omitempty"`
	Mem        *MemMetrics        `json:"mem,omitempty"`
	CPU        *CPUMetrics        `json:"cpu,omitempty"`
}

Metrics contains all metric types.

func (*Metrics) Merge

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

Merge other into r.

type MetricsClient added in v3.0.13

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

MetricsClient implements MinIO metrics operations

func NewMetricsClient added in v3.0.13

func NewMetricsClient(endpoint string, accessKeyID, secretAccessKey string, secure bool) (*MetricsClient, error)

NewMetricsClient - instantiate minio metrics client honoring Prometheus format Deprecated: please use NewMetricsClientWithOptions

func NewMetricsClientWithOptions added in v3.0.47

func NewMetricsClientWithOptions(endpoint string, opts *Options) (*MetricsClient, error)

NewMetricsClientWithOptions - instantiate minio metrics client honoring Prometheus format

func (*MetricsClient) BucketMetrics added in v3.0.18

func (client *MetricsClient) BucketMetrics(ctx context.Context) ([]*prom2json.Family, error)

BucketMetrics - returns Bucket Metrics in Prometheus format

func (*MetricsClient) ClusterMetrics added in v3.0.15

func (client *MetricsClient) ClusterMetrics(ctx context.Context) ([]*prom2json.Family, error)

ClusterMetrics - returns Cluster Metrics in Prometheus format

func (*MetricsClient) NodeMetrics added in v3.0.13

func (client *MetricsClient) NodeMetrics(ctx context.Context) ([]*prom2json.Family, error)

NodeMetrics - returns Node Metrics in Prometheus format

The client needs to be configured with the endpoint of the desired node

func (*MetricsClient) ResourceMetrics added in v3.0.22

func (client *MetricsClient) ResourceMetrics(ctx context.Context) ([]*prom2json.Family, error)

ResourceMetrics - returns Resource Metrics in Prometheus format

func (*MetricsClient) SetCustomTransport added in v3.0.28

func (client *MetricsClient) SetCustomTransport(customHTTPTransport http.RoundTripper)

SetCustomTransport - set new custom transport. Deprecated: please use Options{Transport: tr} to provide custom transport.

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
	ByJobID  string
	ByDepID  string
}

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"`
	Metrics      *RealtimeMetrics `json:"metrics,omitempty"`
}

MinioInfo contains MinIO server and object storage information.

type NetInfo added in v3.0.23

type NetInfo struct {
	NodeCommon
	Interface       string `json:"interface,omitempty"`
	Driver          string `json:"driver,omitempty"`
	FirmwareVersion string `json:"firmware_version,omitempty"`
}

NetInfo contains information about a network inerface

func GetNetInfo added in v3.0.23

func GetNetInfo(addr string, iface string) (ni NetInfo)

GetNetInfo returns information of the given network interface

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 NetMetrics added in v3.0.7

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

	// net of Interface
	InterfaceName string `json:"interfaceName"`

	NetStats procfs.NetDevLine `json:"netstats"`
}

func (*NetMetrics) Merge added in v3.0.7

func (n *NetMetrics) Merge(other *NetMetrics)

Merge other into 'o'.

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
	Transport http.RoundTripper
}

Options for New method

type Partition

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

	Device       string `json:"device,omitempty"`
	Model        string `json:"model,omitempty"`
	Revision     string `json:"revision,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"`
	SyncState          SyncStatus      `json:"sync"`             // whether to enable| disable synchronous replication
	DefaultBandwidth   BucketBandwidth `json:"defaultbandwidth"` // bandwidth limit per bucket in bytes/sec
	ReplicateILMExpiry bool            `json:"replicate-ilm-expiry"`
}

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 PolicyAssociationReq

type PolicyAssociationReq struct {
	Policies []string `json:"policies"`

	// Exactly one of the following must be non-empty in a valid request.
	User  string `json:"user,omitempty"`
	Group string `json:"group,omitempty"`
}

PolicyAssociationReq - request to attach/detach policies from/to a user or group.

func (PolicyAssociationReq) IsValid

func (p PolicyAssociationReq) IsValid() error

IsValid validates the object and returns a reason for when it is not.

type PolicyAssociationResp

type PolicyAssociationResp struct {
	PoliciesAttached []string `json:"policiesAttached,omitempty"`
	PoliciesDetached []string `json:"policiesDetached,omitempty"`

	UpdatedAt time.Time `json:"updatedAt"`
}

PolicyAssociationResp - result of a policy association request.

type PolicyEntities

type PolicyEntities struct {
	Policy string   `json:"policy"`
	Users  []string `json:"users"`
	Groups []string `json:"groups"`
}

PolicyEntities - policy -> user+group mapping

type PolicyEntitiesQuery

type PolicyEntitiesQuery struct {
	Users  []string
	Groups []string
	Policy []string
}

PolicyEntitiesQuery - contains request info for policy entities query.

type PolicyEntitiesResult

type PolicyEntitiesResult struct {
	Timestamp      time.Time             `json:"timestamp"`
	UserMappings   []UserPolicyEntities  `json:"userMappings,omitempty"`
	GroupMappings  []GroupPolicyEntities `json:"groupMappings,omitempty"`
	PolicyMappings []PolicyEntities      `json:"policyMappings,omitempty"`
}

PolicyEntitiesResult - contains response to a policy entities query.

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"`

	ObjectsDecommissioned     int64 `json:"objectsDecommissioned"`
	ObjectsDecommissionFailed int64 `json:"objectsDecommissionedFailed"`
	BytesDone                 int64 `json:"bytesDecommissioned"`
	BytesFailed               int64 `json:"bytesDecommissionedFailed"`
}

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 QStat added in v3.0.12

type QStat struct {
	Count float64 `json:"count"`
	Bytes float64 `json:"bytes"`
}

QStat represents number of objects and bytes in queue

func (*QStat) Add added in v3.0.12

func (q *QStat) Add(o QStat) QStat

Add two QStat

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 RStat added in v3.0.12

type RStat struct {
	Count float64 `json:"count"`
	Bytes int64   `json:"bytes"`
}

RStat represents count and bytes replicated/failed

func (RStat) Add added in v3.0.12

func (r RStat) Add(r1 RStat) RStat

Add - adds two RStats

func (*RStat) DecodeMsg added in v3.0.12

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

DecodeMsg implements msgp.Decodable

func (RStat) EncodeMsg added in v3.0.12

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

EncodeMsg implements msgp.Encodable

func (RStat) MarshalMsg added in v3.0.12

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

MarshalMsg implements msgp.Marshaler

func (RStat) Msgsize added in v3.0.12

func (z RStat) Msgsize() (s int)

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

func (*RStat) UnmarshalMsg added in v3.0.12

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

UnmarshalMsg implements msgp.Unmarshaler

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 RebalPoolProgress

type RebalPoolProgress struct {
	NumObjects  uint64        `json:"objects"`
	NumVersions uint64        `json:"versions"`
	Bytes       uint64        `json:"bytes"`
	Bucket      string        `json:"bucket"`
	Object      string        `json:"object"`
	Elapsed     time.Duration `json:"elapsed"`
	ETA         time.Duration `json:"eta"`
}

RebalPoolProgress contains metrics like number of objects, versions, etc rebalanced so far.

type RebalancePoolStatus

type RebalancePoolStatus struct {
	ID       int               `json:"id"`                 // Pool index (zero-based)
	Status   string            `json:"status"`             // Active if rebalance is running, empty otherwise
	Used     float64           `json:"used"`               // Percentage used space
	Progress RebalPoolProgress `json:"progress,omitempty"` // is empty when rebalance is not running
}

RebalancePoolStatus contains metrics of a rebalance operation on a given pool

type RebalanceStatus

type RebalanceStatus struct {
	ID        string                // identifies the ongoing rebalance operation by a uuid
	StoppedAt time.Time             `json:"stoppedAt,omitempty"`
	Pools     []RebalancePoolStatus `json:"pools"` // contains all pools, including inactive
}

RebalanceStatus contains metrics and progress related information on all pools

type ReplDiffOpts

type ReplDiffOpts struct {
	ARN     string
	Verbose bool
	Prefix  string
}

ReplDiffOpts holds options for `mc replicate diff` command

type ReplProxyMetric added in v3.0.45

type ReplProxyMetric struct {
	PutTagTotal       uint64 `json:"putTaggingProxyTotal" msg:"ptc"`
	GetTagTotal       uint64 `json:"getTaggingProxyTotal" msg:"gtc"`
	RmvTagTotal       uint64 `json:"removeTaggingProxyTotal" msg:"rtc"`
	GetTotal          uint64 `json:"getProxyTotal" msg:"gc"`
	HeadTotal         uint64 `json:"headProxyTotal" msg:"hc"`
	PutTagFailedTotal uint64 `json:"putTaggingProxyFailed" msg:"ptc"`
	GetTagFailedTotal uint64 `json:"getTaggingProxyFailed" msg:"gtc"`
	RmvTagFailedTotal uint64 `json:"removeTaggingProxyFailed" msg:"rtc"`
	GetFailedTotal    uint64 `json:"getProxyFailed" msg:"gc"`
	HeadFailedTotal   uint64 `json:"headProxyFailed" msg:"hc"`
}

ReplProxyMetric holds stats for replication proxying

func (*ReplProxyMetric) Add added in v3.0.45

func (p *ReplProxyMetric) Add(p2 ReplProxyMetric)

Add updates proxy metrics

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 ReplicateInfo

type ReplicateInfo struct {
	// Last bucket/object batch replicated
	Bucket string `json:"lastBucket"`
	Object string `json:"lastObject"`

	// Verbose information
	Objects          int64 `json:"objects"`
	ObjectsFailed    int64 `json:"objectsFailed"`
	BytesTransferred int64 `json:"bytesTransferred"`
	BytesFailed      int64 `json:"bytesFailed"`
}

type ReplicateRemoveStatus

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

ReplicateRemoveStatus - returns status of unlink request.

type ReplicationMRF added in v3.0.2

type ReplicationMRF struct {
	NodeName   string `json:"nodeName" msg:"n"`
	Bucket     string `json:"bucket" msg:"b"`
	Object     string `json:"object" msg:"o"`
	VersionID  string `json:"versionId" msg:"v"`
	RetryCount int    `json:"retryCount" msg:"rc"`
	Err        string `json:"error,omitempty" msg:"err"`
}

ReplicationMRF represents MRF backlog for a bucket

func (*ReplicationMRF) DecodeMsg added in v3.0.2

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

DecodeMsg implements msgp.Decodable

func (*ReplicationMRF) EncodeMsg added in v3.0.2

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

EncodeMsg implements msgp.Encodable

func (*ReplicationMRF) MarshalMsg added in v3.0.2

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

MarshalMsg implements msgp.Marshaler

func (*ReplicationMRF) Msgsize added in v3.0.2

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

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

func (*ReplicationMRF) UnmarshalMsg added in v3.0.2

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

UnmarshalMsg implements msgp.Unmarshaler

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 ResyncBucketStatus

type ResyncBucketStatus struct {
	Bucket    string `json:"bucket"`
	Status    string `json:"status"`
	ErrDetail string `json:"errorDetail,omitempty"`
}

type S3Options

type S3Options func(*TierS3) error

S3Options supports NewTierS3 to take variadic options

type SRAddOptions added in v3.0.26

type SRAddOptions struct {
	ReplicateILMExpiry bool
}

SRAddOptions holds SR Add 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"`

	// Since Expiry Licfecycle config does not have a json representation, we use its xml
	// byte representation
	ExpiryLCConfig *string `json:"expLCConfig,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"`
	ExpiryLCConfigUpdatedAt    time.Time `json:"expLCTimestamp,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"`

	// Since Expiry Lifecycle config does not have a json representation, we use its xml
	// byte respresentation.
	ExpiryLCConfig *string `json:"expLCConfig,omitempty"`

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

	// ExpiryUpdatedAt - timestamp of last update of expiry rule
	ExpiryUpdatedAt time.Time `json:"expiryUpdatedAt,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 SRCredInfo added in v3.0.6

type SRCredInfo struct {
	AccessKey string `json:"accessKey"`

	// This type corresponds to github.com/minio/minio/cmd.IAMUserType
	IAMUserType int `json:"iamUserType"`

	IsDeleteReq bool `json:"isDeleteReq,omitempty"`

	// This is the JSON encoded value of github.com/minio/minio/cmd.UserIdentity
	UserIdentityJSON json.RawMessage `json:"userIdentityJSON"`
}

SRCredInfo - represents a credential change (create/update/delete) to be replicated. This replaces `SvcAccChange`, `STSCredential` and `IAMUser` and will DEPRECATE them.

type SREditOptions added in v3.0.26

type SREditOptions struct {
	DisableILMExpiryReplication bool
	EnableILMExpiryReplication  bool
}

SREditOptions holds SR Edit options

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

	// SRILMExpiryRuleEntity ILM expiry rule entity type
	SRILMExpiryRuleEntity
)

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 = SRIAMItemGroupInfo
	GroupInfo *SRGroupInfo `json:"groupInfo"`

	// Used when Type = SRIAMItemCredential
	CredentialInfo *SRCredInfo `json:"credentialChange"`

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

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

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

	// 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 SRILMExpiryStatsSummary added in v3.0.28

type SRILMExpiryStatsSummary struct {
	DeploymentID          string
	ILMExpiryRuleMismatch bool
	HasILMExpiryRules     bool
}

SRILMExpiryStatsSummary has status of ILM Expiry rules metadata replication misses

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
	ILMExpiryRules map[string]ILMExpiryRule      // map of ILM Expiry rule to content
	State          SRStateInfo                   // peer state
}

SRInfo gets replication metadata for a site

type SRMetric added in v3.0.12

type SRMetric struct {
	DeploymentID  string        `json:"deploymentID"`
	Endpoint      string        `json:"endpoint"`
	TotalDowntime time.Duration `json:"totalDowntime"`
	LastOnline    time.Time     `json:"lastOnline"`
	Online        bool          `json:"isOnline"`
	Latency       LatencyStat   `json:"latency"`

	// replication metrics across buckets roll up
	ReplicatedSize int64 `json:"replicatedSize"`
	// Total number of completed operations
	ReplicatedCount int64 `json:"replicatedCount"`
	// ReplicationErrorStats captures replication errors
	Failed TimedErrStats `json:"failed,omitempty"`
	// XferStats captures transfer stats
	XferStats map[replication.MetricName]replication.XferStats `json:"transferSummary"`
	// MRFStats captures current backlog entries in the last 5 minutes
	MRFStats replication.ReplMRFStats `json:"mrfStats"`
}

SRMetric - captures replication metrics for a site replication peer

type SRMetricsSummary added in v3.0.12

type SRMetricsSummary struct {
	// op metrics roll up
	ActiveWorkers WorkerStat `json:"activeWorkers"`
	// Total Replica size in bytes
	ReplicaSize int64 `json:"replicaSize"`
	// Total count of replica received
	ReplicaCount int64 `json:"replicaCount"`
	// queue metrics
	Queued InQueueMetric `json:"queued"`
	// proxied metrics
	Proxied ReplProxyMetric `json:"proxied"`
	// replication metrics summary for each site replication peer
	Metrics map[string]SRMetric `json:"replMetrics"`
	// uptime of node being queried for site replication metrics
	Uptime int64 `json:"uptime"`
}

SRMetricsSummary captures summary of replication counts across buckets on site along with op metrics rollup.

type SRPeerJoinReq

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

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 {
	RequestingDepID string   `json:"requestingDepID"`
	SiteNames       []string `json:"sites"`
	RemoveAll       bool     `json:"all"` // true if all sites are to be removed.
}

SRRemoveReq - arg body for SRRemoveReq

type SRResyncOpStatus

type SRResyncOpStatus struct {
	OpType    string               `json:"op"` // one of "start" or "cancel"
	ResyncID  string               `json:"id"`
	Status    string               `json:"status"`
	Buckets   []ResyncBucketStatus `json:"buckets"`
	ErrDetail string               `json:"errorDetail,omitempty"`
}

SRResyncOpStatus - returns status of resync start request.

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
	ReplicatedILMExpiryRules      int // count of ILM expiry rules 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
	TotalILMExpiryRulesCount     int // total number of ILM expiry rules seen on the site
}

SRSiteSummary holds the count of replicated items in site replication

type SRStateEditReq added in v3.0.32

type SRStateEditReq struct {
	Peers     map[string]PeerInfo `json:"peers"`
	UpdatedAt time.Time           `json:"updatedAt"`
}

SRStateEditReq - arg body for SRStateEditReq

type SRStateInfo added in v3.0.32

type SRStateInfo struct {
	Name      string              `json:"name"`
	Peers     map[string]PeerInfo `json:"peers"`
	UpdatedAt time.Time           `json:"updatedAt"`
}

SRStateInfo - site replication state information

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
	MaxILMExpiryRules int                      // maxmimum ILM Expiry rules 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
	// Metrics summary of SRMetrics
	Metrics SRMetricsSummary // metrics summary. This is populated if buckets/bucket entity requested
	// ILMExpiryStats map of ILM Expiry rules to slice of deployment IDs with stats. This is populated if there
	// are mismatches or if a specific ILM expiry rule's stats are requested
	ILMExpiryStats map[string]map[string]SRILMExpiryStatsSummary
}

SRStatusInfo returns detailed status on site replication status

type SRStatusOptions

type SRStatusOptions struct {
	Buckets        bool
	Policies       bool
	Users          bool
	Groups         bool
	Metrics        bool
	ILMExpiryRules bool
	PeerState      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"`
	Name          string                 `json:"name"`
	Description   string                 `json:"description"`
	Expiration    *time.Time             `json:"expiration,omitempty"`
}

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"`
	Name          string          `json:"name"`
	Description   string          `json:"description"`
	SessionPolicy json.RawMessage `json:"sessionPolicy"`
	Expiration    *time.Time      `json:"expiration,omitempty"`
}

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"` // Only set if len(PoolNumbers) == 1
	PoolNumbers    []int             `json:"poolNumbers,omitempty"`
	MemStats       MemStats          `json:"mem_stats"`
	GoMaxProcs     int               `json:"go_max_procs"`
	NumCPU         int               `json:"num_cpu"`
	RuntimeVersion string            `json:"runtime_version"`
	GCStats        *GCStats          `json:"gc_stats,omitempty"`
	MinioEnvVars   map[string]string `json:"minio_env_vars,omitempty"`
}

ServerInfo holds server information

type ServerInfoOpts added in v3.0.46

type ServerInfoOpts struct {
	Metrics bool
}

ServerInfoOpts ask for additional data from the server

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 ServerPeerUpdateStatus added in v3.0.40

type ServerPeerUpdateStatus struct {
	Host           string                 `json:"host"`
	Err            string                 `json:"err,omitempty"`
	CurrentVersion string                 `json:"currentVersion"`
	UpdatedVersion string                 `json:"updatedVersion"`
	WaitingDrives  map[string]DiskMetrics `json:"waitingDrives,omitempty"`
}

ServerPeerUpdateStatus server update peer binary update result

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"` // Only set if len(PoolNumbers) == 1
	PoolNumbers    []int             `json:"poolNumbers,omitempty"`
	MemStats       MemStats          `json:"mem_stats"`
	GoMaxProcs     int               `json:"go_max_procs,omitempty"`
	NumCPU         int               `json:"num_cpu,omitempty"`
	RuntimeVersion string            `json:"runtime_version,omitempty"`
	GCStats        *GCStats          `json:"gc_stats,omitempty"`
	MinioEnvVars   map[string]string `json:"minio_env_vars,omitempty"`
}

ServerProperties holds server information

type ServerUpdateOpts added in v3.0.40

type ServerUpdateOpts struct {
	UpdateURL string
	DryRun    bool
}

ServerUpdateOpts specifies the URL (optionally to download the binary from) also allows a dry-run, the new API is idempotent which means you can run it as many times as you want and any server that is not upgraded automatically does get upgraded eventually to the relevant version.

type ServerUpdateStatus

type ServerUpdateStatus struct {
	// Deprecated: this struct is fully deprecated since Jan 2024.
	CurrentVersion string `json:"currentVersion"`
	UpdatedVersion string `json:"updatedVersion"`
}

ServerUpdateStatus - contains the response of service update API

type ServerUpdateStatusV2 added in v3.0.40

type ServerUpdateStatusV2 struct {
	DryRun  bool                     `json:"dryRun"`
	Results []ServerPeerUpdateStatus `json:"results,omitempty"`
}

ServerUpdateStatusV2 server update status

type ServiceAccountInfo

type ServiceAccountInfo struct {
	AccessKey  string     `json:"accessKey"`
	Expiration *time.Time `json:"expiration,omitempty"`
}

type ServiceAction

type ServiceAction string

ServiceAction - type to restrict service-action values

type ServiceActionOpts added in v3.0.40

type ServiceActionOpts struct {
	Action ServiceAction
	DryRun bool
}

ServiceActionOpts specifies the action that the service is requested to take, dryRun indicates if the action is a no-op, force indicates that server must make best effort to restart the process.

type ServiceActionPeerResult added in v3.0.40

type ServiceActionPeerResult struct {
	Host          string                 `json:"host"`
	Err           string                 `json:"err,omitempty"`
	WaitingDrives map[string]DiskMetrics `json:"waitingDrives,omitempty"`
}

ServiceActionPeerResult service peer result

type ServiceActionResult added in v3.0.40

type ServiceActionResult struct {
	Action  ServiceAction             `json:"action"`
	DryRun  bool                      `json:"dryRun"`
	Results []ServiceActionPeerResult `json:"results,omitempty"`
}

ServiceActionResult service action result

type ServicePrincipalAuth added in v3.0.37

type ServicePrincipalAuth struct {
	TenantID     string `json:",omitempty"`
	ClientID     string `json:",omitempty"`
	ClientSecret string `json:",omitempty"`
}

ServicePrincipalAuth holds fields for a successful SP authentication with Azure

func (*ServicePrincipalAuth) DecodeMsg added in v3.0.37

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

DecodeMsg implements msgp.Decodable

func (ServicePrincipalAuth) EncodeMsg added in v3.0.37

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

EncodeMsg implements msgp.Encodable

func (ServicePrincipalAuth) MarshalMsg added in v3.0.37

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

MarshalMsg implements msgp.Marshaler

func (ServicePrincipalAuth) Msgsize added in v3.0.37

func (z ServicePrincipalAuth) Msgsize() (s int)

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

func (*ServicePrincipalAuth) UnmarshalMsg added in v3.0.37

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

UnmarshalMsg implements msgp.Unmarshaler

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
	BatchReplication  bool
	BatchKeyRotation  bool
	BatchExpire       bool
	BatchAll          bool
	Rebalance         bool
	ReplicationResync bool
	Bootstrap         bool
	FTP               bool
	ILM               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"` // deprecated july 2023
	KMSStatus     []KMS                         `json:"kmsStatus,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 SiteNetPerfNodeResult added in v3.0.5

type SiteNetPerfNodeResult struct {
	Endpoint        string        `json:"endpoint"`
	TX              uint64        `json:"tx"` // transfer rate in bytes
	TXTotalDuration time.Duration `json:"txTotalDuration"`
	RX              uint64        `json:"rx"` // received rate in bytes
	RXTotalDuration time.Duration `json:"rxTotalDuration"`
	TotalConn       uint64        `json:"totalConn"`
	Error           string        `json:"error,omitempty"`
}

SiteNetPerfNodeResult - stats from each server

type SiteNetPerfResult added in v3.0.5

type SiteNetPerfResult struct {
	NodeResults []SiteNetPerfNodeResult `json:"nodeResults"`
}

SiteNetPerfResult - aggregate results from all servers

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 SiteResyncMetrics

type SiteResyncMetrics struct {
	// Time these metrics were collected
	CollectedAt time.Time `json:"collected"`
	// Status of resync operation
	ResyncStatus string    `json:"resyncStatus,omitempty"`
	StartTime    time.Time `json:"startTime"`
	LastUpdate   time.Time `json:"lastUpdate"`
	NumBuckets   int64     `json:"numBuckets"`
	ResyncID     string    `json:"resyncID"`
	DeplID       string    `json:"deplID"`

	// Completed size in bytes
	ReplicatedSize int64 `json:"completedReplicationSize"`
	// Total number of objects replicated
	ReplicatedCount int64 `json:"replicationCount"`
	// Failed size in bytes
	FailedSize int64 `json:"failedReplicationSize"`
	// Total number of failed operations
	FailedCount int64 `json:"failedReplicationCount"`
	// Buckets that could not be synced
	FailedBuckets []string `json:"failedBuckets"`
	// Last bucket/object replicated.
	Bucket string `json:"bucket,omitempty"`
	Object string `json:"object,omitempty"`
}

SiteResyncMetrics contains metrics for site resync operation

func (SiteResyncMetrics) Complete

func (o SiteResyncMetrics) Complete() bool

func (*SiteResyncMetrics) Merge

func (o *SiteResyncMetrics) Merge(other *SiteResyncMetrics)

Merge other into 'o'.

type SiteResyncOp

type SiteResyncOp string

SiteResyncOp type of resync operation

const (
	// SiteResyncStart starts a site resync operation
	SiteResyncStart SiteResyncOp = "start"
	// SiteResyncCancel cancels ongoing site resync
	SiteResyncCancel SiteResyncOp = "cancel"
)

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
	NoClear      bool          // Avoid cleanup after running an object speed test
	EnableSha256 bool          // Enable calculating sha256 for uploads
}

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 SyncStatus

type SyncStatus string // change in sync state
const (
	SyncEnabled  SyncStatus = "enable"
	SyncDisabled SyncStatus = "disable"
)

func (SyncStatus) Empty

func (s SyncStatus) Empty() bool

type SysConfig

type SysConfig struct {
	NodeCommon

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

SysConfig - info about services that affect minio

func GetSysConfig

func GetSysConfig(_ 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(_ 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"`
	NetInfo        []NetInfo      `json:"netinfo,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(_ 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"`
	Checksum      string    `json:"checksum"`
}

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 TemporaryAccountInfoResp

type TemporaryAccountInfoResp InfoServiceAccountResp

TemporaryAccountInfoResp is the response body of the info temporary call

type TgtDiffInfo

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

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"`

	SPAuth ServicePrincipalAuth `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) IsSPEnabled added in v3.0.37

func (ti TierAzure) IsSPEnabled() bool

IsSPEnabled returns true if all SP related fields are provided

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"`

	AWSRole                     bool   `json:"awsrole"`
	AWSRoleWebIdentityTokenFile string `json:"awsroleWebIdentity,omitempty"`
	AWSRoleARN                  string `json:"awsroleARN,omitempty"`

	AzSP ServicePrincipalAuth `json:"azSP,omitempty"`

	CredsJSON []byte `json:"creds,omitempty"`
}

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"`
	AWSRoleWebIdentityTokenFile string `json:",omitempty"`
	AWSRoleARN                  string `json:",omitempty"`
	AWSRoleSessionName          string `json:",omitempty"`
	AWSRoleDurationSeconds      int    `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"`
	TimeZone          string    `json:"time_zone"`
}

TimeInfo contains current time with timezone, 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 TimedErrStats added in v3.0.12

type TimedErrStats struct {
	LastMinute RStat `json:"lastMinute"`
	LastHour   RStat `json:"lastHour"`
	Totals     RStat `json:"totals"`
	// ErrCounts is a map of error codes to count of errors since server start - tracks
	// only AccessDenied errors for now.
	ErrCounts map[string]int `json:"errCounts,omitempty"`
}

TimedErrStats has failed replication stats across time windows

func (TimedErrStats) Add added in v3.0.12

Add - adds two TimedErrStats

func (*TimedErrStats) DecodeMsg added in v3.0.12

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

DecodeMsg implements msgp.Decodable

func (*TimedErrStats) EncodeMsg added in v3.0.12

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

EncodeMsg implements msgp.Encodable

func (*TimedErrStats) MarshalMsg added in v3.0.12

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

MarshalMsg implements msgp.Marshaler

func (*TimedErrStats) Msgsize added in v3.0.12

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

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

func (*TimedErrStats) UnmarshalMsg added in v3.0.12

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

UnmarshalMsg implements msgp.Unmarshaler

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"`
	Custom     map[string]string `json:"custom,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
	// TraceBatchReplication will trace batch replication operations.
	TraceBatchReplication
	// TraceBatchKeyRotation will trace batch keyrotation operations.
	TraceBatchKeyRotation
	// TraceBatchExpire will trace batch expiration operations.
	TraceBatchExpire
	// TraceRebalance will trace rebalance operations
	TraceRebalance
	// TraceReplicationResync will trace replication resync operations.
	TraceReplicationResync
	// TraceBootstrap will trace events during MinIO cluster bootstrap
	TraceBootstrap
	// TraceFTP will trace events from MinIO FTP Server
	TraceFTP
	// TraceILM will trace events during MinIO ILM operations
	TraceILM

	// 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"`
	NewName        string          `json:"newName,omitempty"`
	NewDescription string          `json:"newDescription,omitempty"`
	NewExpiration  *time.Time      `json:"newExpiration,omitempty"`
}

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

func (*UpdateServiceAccountReq) Validate

func (u *UpdateServiceAccountReq) Validate() error

type Usage

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

Usage contains the total size used

type UserAuthInfo added in v3.0.3

type UserAuthInfo struct {
	Type UserAuthType `json:"type"`

	// Specifies the external server that authenticated the server (empty for
	// builtin IDP)
	AuthServer string `json:"authServer,omitempty"`

	// Specifies the user ID as present in the external auth server (e.g. in
	// OIDC could be the email of the user). For builtin, this would be the same
	// as the access key.
	AuthServerUserID string `json:"authServerUserID,omitempty"`
}

UserAuthInfo contains info about how the user is authenticated.

type UserAuthType added in v3.0.3

type UserAuthType string

UserAuthType indicates the type of authentication for the user.

const (
	BuiltinUserAuthType UserAuthType = "builtin"
	LDAPUserAuthType                 = "ldap"
)

Valid values for UserAuthType.

type UserInfo

type UserInfo struct {
	AuthInfo   *UserAuthInfo `json:"userAuthInfo,omitempty"`
	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 UserPolicyEntities

type UserPolicyEntities struct {
	User     string   `json:"user"`
	Policies []string `json:"policies"`
}

UserPolicyEntities - user -> policies mapping

type Versions

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

Versions contains the number of versions

type WorkerStat added in v3.0.12

type WorkerStat struct {
	Curr int     `json:"curr"`
	Avg  float32 `json:"avg"`
	Max  int     `json:"max"`
}

WorkerStat captures number of replication workers

type XFSErrorConfig

type XFSErrorConfig struct {
	ConfigFile string `json:"config_file"`
	MaxRetries int    `json:"max_retries"`
}

XFSErrorConfig - stores XFS error configuration info for max_retries

type XFSErrorConfigs

type XFSErrorConfigs struct {
	Configs []XFSErrorConfig `json:"configs,omitempty"`
	Error   string           `json:"error,omitempty"`
}

XFSErrorConfigs - stores the error configs of all XFS devices on the server

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