|
| 1 | +// |
| 2 | +// Copyright (c) 2015-2025 MinIO, Inc. |
| 3 | +// |
| 4 | +// This file is part of MinIO Object Storage stack |
| 5 | +// |
| 6 | +// This program is free software: you can redistribute it and/or modify |
| 7 | +// it under the terms of the GNU Affero General Public License as |
| 8 | +// published by the Free Software Foundation, either version 3 of the |
| 9 | +// License, or (at your option) any later version. |
| 10 | +// |
| 11 | +// This program is distributed in the hope that it will be useful, |
| 12 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +// GNU Affero General Public License for more details. |
| 15 | +// |
| 16 | +// You should have received a copy of the GNU Affero General Public License |
| 17 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | +// |
| 19 | + |
| 20 | +package madmin |
| 21 | + |
| 22 | +import ( |
| 23 | + "time" |
| 24 | + |
| 25 | + "github.com/minio/minio-go/v7/pkg/replication" |
| 26 | +) |
| 27 | + |
| 28 | +type ReplDiagInfo struct { |
| 29 | + Error string `json:"error,omitempty"` |
| 30 | + SREnabled bool `json:"site_replication_enabled"` |
| 31 | + ActiveWorkers WorkerStat `json:"active_workers,omitempty"` |
| 32 | + Queued InQueueMetric `json:"queued,omitempty"` |
| 33 | + ReplicaCount int64 `json:"replica_count,omitempty"` |
| 34 | + ReplicaSize int64 `json:"replica_size,omitempty"` |
| 35 | + Proxying bool `json:"proxying,omitempty"` |
| 36 | + Proxied ReplProxyMetric `json:"proxied,omitempty"` |
| 37 | + Sites []ReplDiagSite `json:"sites,omitempty"` |
| 38 | + RDReplicatedBuckets []ReplDiagReplBucket `json:"replicated_buckets,omitempty"` |
| 39 | +} |
| 40 | + |
| 41 | +type ReplDiagSite struct { |
| 42 | + Addr string `json:"addr,omitempty"` |
| 43 | + DeploymentID string `json:"deployment_id"` |
| 44 | + Info ReplDiagSiteInfo `json:"info,omitempty"` |
| 45 | +} |
| 46 | + |
| 47 | +type ReplDiagSiteInfo struct { |
| 48 | + Nodes []ReplDiagNode `json:"nodes,omitempty"` |
| 49 | + LDAPEnabled bool `json:"ldap_enabled,omitempty"` |
| 50 | + OpenIDEnabled bool `json:"openid_enabled,omitempty"` |
| 51 | + BucketsCount int `json:"buckets_count,omitempty"` |
| 52 | + Edge bool `json:"edge,omitempty"` |
| 53 | + ILMEnabled bool `json:"ilm_enabled,omitempty"` |
| 54 | + EncryptionEnabled bool `json:"encryption_enabled,omitempty"` |
| 55 | + ILMExpiryReplication bool `json:"ilm_expiry_replication,omitempty"` |
| 56 | + ObjectLockingEnabled bool `json:"object_locking_enabled,omitempty"` |
| 57 | + Throttle ReplDiagThrottle `json:"throttle,omitempty"` |
| 58 | + ReplicatedCount int64 `json:"replicated_count,omitempty"` |
| 59 | + ReplicatedSize int64 `json:"replicated_size,omitempty"` |
| 60 | + ResyncStatus string `json:"resync_status"` |
| 61 | +} |
| 62 | + |
| 63 | +type ReplDiagNode struct { |
| 64 | + Addr string `json:"addr,omitempty"` |
| 65 | + MinIOVersion string `json:"minio_version,omitempty"` |
| 66 | + Uptime int64 `json:"uptime,omitempty"` |
| 67 | + PoolID int `json:"poolid,omitempty"` |
| 68 | + // SetID int `json:"setid,omitempty"` |
| 69 | + IsLeader bool `json:"is_leader,omitempty"` |
| 70 | + ILMExpiryInProgress bool `json:"ilm_expiry_in_progress,omitempty"` |
| 71 | +} |
| 72 | + |
| 73 | +type ReplDiagReplBucket struct { |
| 74 | + Name string `json:"name,omitempty"` |
| 75 | + ReplicationInfo ReplDiagBucketReplInfo `json:"replication_info,omitempty"` |
| 76 | + ReplicationTargets []ReplDiagBucketReplTarget `json:"replication_targets,omitempty"` |
| 77 | +} |
| 78 | + |
| 79 | +type ReplDiagBucketReplTarget struct { |
| 80 | + SourceBucket string `json:"source_bucket,omitempty"` |
| 81 | + TargetBucket string `json:"target_bucket,omitempty"` |
| 82 | + Addr string `json:"addr,omitempty"` |
| 83 | + Online bool `json:"online,omitempty"` |
| 84 | + TotalDowntime time.Duration `json:"total_downtime,omitempty"` |
| 85 | + CurrentDowntime time.Duration `json:"current_downtime,omitempty"` |
| 86 | + AdminPermissions bool `json:"admin_permissions,omitempty"` |
| 87 | + SyncReplication bool `json:"sync_replication,omitempty"` |
| 88 | + HeartbeatErrCount int64 `json:"heartbeat_err_count,omitempty"` |
| 89 | + BandwidthLimit uint64 `json:"bandwidth_limit,omitempty"` |
| 90 | + Latency LatencyStat `json:"xfer_rate,omitempty"` |
| 91 | + Edge bool `json:"edge,omitempty"` |
| 92 | + HealthCheckDuration time.Duration `json:"heath_check,omitempty"` |
| 93 | + DisableProxying bool `json:"disable_proxying"` |
| 94 | + DeleteReplication bool `json:"delete_replication,omitempty"` |
| 95 | + DeleteMarkerReplication bool `json:"delete_marker_replication,omitempty"` |
| 96 | + ReplicationPriority int `json:"replication_priority,omitempty"` |
| 97 | + ExistingObjectReplication bool `json:"existing_object_replication,omitempty"` |
| 98 | + MetadataSync bool `json:"metadata_sync,omitempty"` |
| 99 | +} |
| 100 | + |
| 101 | +type ReplDiagBucketReplInfo struct { |
| 102 | + VersionEnabled bool `json:"version_enabled,omitempty"` |
| 103 | + ObjectLocking bool `json:"object_locking,omitempty"` |
| 104 | + ExcludedPrefixes []string `json:"excluded_prefixes,omitempty"` |
| 105 | + ILM ReplDiagILMInfo `json:"ilm,omitempty"` |
| 106 | + Encryption ReplDiagEncInfo `json:"encryption,omitempty"` |
| 107 | + Config replication.Config `json:"config,omitempty"` |
| 108 | + Resync ReplDiagBucketResyncInfo `json:"resync,omitempty"` |
| 109 | +} |
| 110 | + |
| 111 | +type ReplDiagILMInfo struct { |
| 112 | + Enabled bool `json:"enabled,omitempty"` |
| 113 | + Rules []ReplDiagILMRule `json:"rules,omitempty"` |
| 114 | +} |
| 115 | + |
| 116 | +type ReplDiagILMRule struct { |
| 117 | + ID string `json:"id,omitempty"` |
| 118 | + Expiration bool `json:"expiration,omitempty"` |
| 119 | + Transition bool `json:"transition,omitempty"` |
| 120 | +} |
| 121 | + |
| 122 | +type ReplDiagEncInfo struct { |
| 123 | + Enabled bool `json:"enabled,omitempty"` |
| 124 | + EncRules []BucketEncInfo `json:"enc_rules,omitempty"` |
| 125 | +} |
| 126 | + |
| 127 | +type BucketEncInfo struct { |
| 128 | + Algorithm string `json:"algorithm,omitempty"` |
| 129 | + EncKey string `json:"enc_key,omitempty"` |
| 130 | +} |
| 131 | + |
| 132 | +type ReplDiagBucketResyncInfo struct { |
| 133 | + InProgress bool `json:"in_progress,omitempty"` |
| 134 | + StartTime time.Time `json:"start_time,omitempty"` |
| 135 | + FailedCount int64 `json:"failed_count,omitempty"` |
| 136 | + FailedSize int64 `json:"failed_size,omitempty"` |
| 137 | + ReplicatedCount int64 `json:"replicated_count,omitempty"` |
| 138 | + ReplicatedSize int64 `json:"replicated_size,omitempty"` |
| 139 | +} |
| 140 | + |
| 141 | +type ReplDiagThrottle struct { |
| 142 | + IsSet bool `json:"is_set,omitempty"` |
| 143 | + Limit uint64 `json:"limit,omitempty"` |
| 144 | +} |
0 commit comments