Skip to content

Commit 60acbd9

Browse files
Add v4 Admin APIs, older APIs move to v3 (#333)
* Add v4 Admin APIs, older APIs move to v3 - ClusterInfo - PoolList -> []PoolInfo - PoolInfo(index) -> PoolInfo * remove all deprecated APIs since we are moving to v4 with major breaking changes
1 parent c3c7724 commit 60acbd9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2111
-1776
lines changed

.github/workflows/go.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
go-version: [1.22.x,1.23.x]
20+
go-version: [1.23.x, 1.24.x]
2121
steps:
2222
- name: Set up Go ${{ matrix.go-version }}
2323
uses: actions/setup-go@v5
@@ -30,8 +30,6 @@ jobs:
3030

3131
- name: Check lint
3232
uses: golangci/golangci-lint-action@v6
33-
with:
34-
version: v1.61
3533

3634
- name: Regenerate, vet and test
3735
run: |

.golangci.yml

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
linters-settings:
2-
golint:
3-
min-confidence: 0
4-
5-
misspell:
6-
locale: US
7-
81
linters:
92
disable-all: true
103
enable:

README.md

+6-540
Large diffs are not rendered by default.

api-log.go

+2-18
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@ import (
3131
type LogMask uint64
3232

3333
const (
34-
// LogMaskMinIO - mask for MinIO type log
35-
LogMaskMinIO LogMask = 1 << iota // Deprecated Jan 2024
36-
// LogMaskApplication - mask for MinIO type log
37-
LogMaskApplication // Deprecated Jan 2024
38-
39-
LogMaskFatal
34+
LogMaskFatal LogMask = 1 << iota
4035
LogMaskWarning
4136
LogMaskError
4237
LogMaskEvent
@@ -60,13 +55,6 @@ func (m LogMask) Contains(other LogMask) bool {
6055
type LogKind string
6156

6257
const (
63-
// LogKindMinio - MinIO log type
64-
LogKindMinio LogKind = "MINIO" // Deprecated Jan 2024
65-
// LogKindApplication - Application log type
66-
LogKindApplication LogKind = "APPLICATION" // Deprecated Jan 2024
67-
// LogKindAll - all logs type
68-
LogKindAll LogKind = "ALL" // Deprecated Jan 2024
69-
7058
LogKindFatal LogKind = "FATAL"
7159
LogKindWarning LogKind = "WARNING"
7260
LogKindError LogKind = "ERROR"
@@ -77,10 +65,6 @@ const (
7765
// LogMask returns the mask based on the kind.
7866
func (l LogKind) LogMask() LogMask {
7967
switch l {
80-
case LogKindMinio:
81-
return LogMaskMinIO
82-
case LogKindApplication:
83-
return LogMaskApplication
8468
case LogKindFatal:
8569
return LogMaskFatal
8670
case LogKindWarning:
@@ -120,7 +104,7 @@ func (adm AdminClient) GetLogs(ctx context.Context, node string, lineCnt int, lo
120104
urlValues.Set("logType", logKind)
121105
for {
122106
reqData := requestData{
123-
relPath: adminAPIPrefix + "/log",
107+
relPath: adminAPIPrefixV3 + "/log",
124108
queryValues: urlValues,
125109
}
126110
// Execute GET to call log handler

api.go

-22
Original file line numberDiff line numberDiff line change
@@ -175,28 +175,6 @@ func (adm *AdminClient) SetAppInfo(appName string, appVersion string) {
175175
}
176176
}
177177

178-
// SetCustomTransport - set new custom transport.
179-
// Deprecated: please use Options{Transport: tr} to provide custom transport.
180-
func (adm *AdminClient) SetCustomTransport(customHTTPTransport http.RoundTripper) {
181-
// Set this to override default transport
182-
// ``http.DefaultTransport``.
183-
//
184-
// This transport is usually needed for debugging OR to add your
185-
// own custom TLS certificates on the client transport, for custom
186-
// CA's and certs which are not part of standard certificate
187-
// authority follow this example :-
188-
//
189-
// tr := &http.Transport{
190-
// TLSClientConfig: &tls.Config{RootCAs: pool},
191-
// DisableCompression: true,
192-
// }
193-
// api.SetTransport(tr)
194-
//
195-
if adm.httpClient != nil {
196-
adm.httpClient.Transport = customHTTPTransport
197-
}
198-
}
199-
200178
// TraceOn - enable HTTP tracing.
201179
func (adm *AdminClient) TraceOn(outputStream io.Writer) {
202180
// if outputStream is nil then default to os.Stdout.

api_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ package madmin_test
2323
import (
2424
"testing"
2525

26-
"github.com/minio/madmin-go/v3"
26+
"github.com/minio/madmin-go/v4"
2727
)
2828

2929
func TestMinioAdminClient(t *testing.T) {

bandwidth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (adm *AdminClient) GetBucketBandwidth(ctx context.Context, buckets ...strin
5454
}
5555

5656
reqData := requestData{
57-
relPath: adminAPIPrefix + "/bandwidth",
57+
relPath: adminAPIPrefixV3 + "/bandwidth",
5858
queryValues: queryValues,
5959
}
6060
resp, err := adm.executeMethod(ctx, http.MethodGet, reqData)

batch-job.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ type BatchJobResult struct {
204204
func (adm *AdminClient) StartBatchJob(ctx context.Context, job string) (BatchJobResult, error) {
205205
resp, err := adm.executeMethod(ctx, http.MethodPost,
206206
requestData{
207-
relPath: adminAPIPrefix + "/start-job",
207+
relPath: adminAPIPrefixV3 + "/start-job",
208208
content: []byte(job),
209209
},
210210
)
@@ -237,7 +237,7 @@ func (adm *AdminClient) BatchJobStatus(ctx context.Context, jobID string) (Batch
237237

238238
resp, err := adm.executeMethod(ctx, http.MethodGet,
239239
requestData{
240-
relPath: adminAPIPrefix + "/status-job",
240+
relPath: adminAPIPrefixV3 + "/status-job",
241241
queryValues: values,
242242
},
243243
)
@@ -265,7 +265,7 @@ func (adm *AdminClient) DescribeBatchJob(ctx context.Context, jobID string) (str
265265

266266
resp, err := adm.executeMethod(ctx, http.MethodGet,
267267
requestData{
268-
relPath: adminAPIPrefix + "/describe-job",
268+
relPath: adminAPIPrefixV3 + "/describe-job",
269269
queryValues: values,
270270
},
271271
)
@@ -327,7 +327,7 @@ func (adm *AdminClient) ListBatchJobs(ctx context.Context, fl *ListBatchJobsFilt
327327

328328
resp, err := adm.executeMethod(ctx, http.MethodGet,
329329
requestData{
330-
relPath: adminAPIPrefix + "/list-jobs",
330+
relPath: adminAPIPrefixV3 + "/list-jobs",
331331
queryValues: values,
332332
},
333333
)
@@ -356,7 +356,7 @@ func (adm *AdminClient) CancelBatchJob(ctx context.Context, jobID string) error
356356

357357
resp, err := adm.executeMethod(ctx, http.MethodDelete,
358358
requestData{
359-
relPath: adminAPIPrefix + "/cancel-job",
359+
relPath: adminAPIPrefixV3 + "/cancel-job",
360360
queryValues: values,
361361
},
362362
)

bucket-metadata.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929

3030
// ExportBucketMetadata makes an admin call to export bucket metadata of a bucket
3131
func (adm *AdminClient) ExportBucketMetadata(ctx context.Context, bucket string) (io.ReadCloser, error) {
32-
path := adminAPIPrefix + "/export-bucket-metadata"
32+
path := adminAPIPrefixV3 + "/export-bucket-metadata"
3333
queryValues := url.Values{}
3434
queryValues.Set("bucket", bucket)
3535

@@ -82,7 +82,7 @@ func (adm *AdminClient) ImportBucketMetadata(ctx context.Context, bucket string,
8282
return r, err
8383
}
8484

85-
path := adminAPIPrefix + "/import-bucket-metadata"
85+
path := adminAPIPrefixV3 + "/import-bucket-metadata"
8686
queryValues := url.Values{}
8787
queryValues.Set("bucket", bucket)
8888

cluster-commands.go

+15-15
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (adm *AdminClient) SiteReplicationAdd(ctx context.Context, sites []PeerSite
8686
q.Set("api-version", SiteReplAPIVersion)
8787

8888
reqData := requestData{
89-
relPath: adminAPIPrefix + "/site-replication/add",
89+
relPath: adminAPIPrefixV3 + "/site-replication/add",
9090
content: encBytes,
9191
queryValues: q,
9292
}
@@ -129,7 +129,7 @@ func (adm *AdminClient) SiteReplicationInfo(ctx context.Context) (info SiteRepli
129129
q.Set("api-version", SiteReplAPIVersion)
130130

131131
reqData := requestData{
132-
relPath: adminAPIPrefix + "/site-replication/info",
132+
relPath: adminAPIPrefixV3 + "/site-replication/info",
133133
queryValues: q,
134134
}
135135

@@ -207,7 +207,7 @@ func (adm *AdminClient) SRPeerJoin(ctx context.Context, r SRPeerJoinReq) error {
207207
q.Set("api-version", SiteReplAPIVersion)
208208

209209
reqData := requestData{
210-
relPath: adminAPIPrefix + "/site-replication/peer/join",
210+
relPath: adminAPIPrefixV3 + "/site-replication/peer/join",
211211
content: encBuf,
212212
queryValues: q,
213213
}
@@ -259,7 +259,7 @@ func (adm *AdminClient) SRPeerBucketOps(ctx context.Context, bucket string, op B
259259

260260
reqData := requestData{
261261
queryValues: v,
262-
relPath: adminAPIPrefix + "/site-replication/peer/bucket-ops",
262+
relPath: adminAPIPrefixV3 + "/site-replication/peer/bucket-ops",
263263
}
264264

265265
resp, err := adm.executeMethod(ctx, http.MethodPut, reqData)
@@ -446,7 +446,7 @@ func (adm *AdminClient) SRPeerReplicateIAMItem(ctx context.Context, item SRIAMIt
446446
q.Add("api-version", SiteReplAPIVersion)
447447

448448
reqData := requestData{
449-
relPath: adminAPIPrefix + "/site-replication/peer/iam-item",
449+
relPath: adminAPIPrefixV3 + "/site-replication/peer/iam-item",
450450
content: b,
451451
queryValues: q,
452452
}
@@ -527,7 +527,7 @@ func (adm *AdminClient) SRPeerReplicateBucketMeta(ctx context.Context, item SRBu
527527
q.Set("api-version", SiteReplAPIVersion)
528528

529529
reqData := requestData{
530-
relPath: adminAPIPrefix + "/site-replication/peer/bucket-meta",
530+
relPath: adminAPIPrefixV3 + "/site-replication/peer/bucket-meta",
531531
content: b,
532532
queryValues: q,
533533
}
@@ -635,7 +635,7 @@ func (adm *AdminClient) SRPeerGetIDPSettings(ctx context.Context) (info IDPSetti
635635
q.Set("api-version", SiteReplAPIVersion)
636636

637637
reqData := requestData{
638-
relPath: adminAPIPrefix + "/site-replication/peer/idp-settings",
638+
relPath: adminAPIPrefixV3 + "/site-replication/peer/idp-settings",
639639
queryValues: q,
640640
}
641641

@@ -704,7 +704,7 @@ func (adm *AdminClient) SRMetaInfo(ctx context.Context, opts SRStatusOptions) (i
704704
q.Set("api-version", SiteReplAPIVersion)
705705

706706
reqData := requestData{
707-
relPath: adminAPIPrefix + "/site-replication/metainfo",
707+
relPath: adminAPIPrefixV3 + "/site-replication/metainfo",
708708
queryValues: q,
709709
}
710710

@@ -946,7 +946,7 @@ func (adm *AdminClient) SRStatusInfo(ctx context.Context, opts SRStatusOptions)
946946
q.Set("api-version", SiteReplAPIVersion)
947947

948948
reqData := requestData{
949-
relPath: adminAPIPrefix + "/site-replication/status",
949+
relPath: adminAPIPrefixV3 + "/site-replication/status",
950950
queryValues: q,
951951
}
952952

@@ -999,7 +999,7 @@ func (adm *AdminClient) SiteReplicationEdit(ctx context.Context, site PeerInfo,
999999
q.Set("api-version", SiteReplAPIVersion)
10001000

10011001
reqData := requestData{
1002-
relPath: adminAPIPrefix + "/site-replication/edit",
1002+
relPath: adminAPIPrefixV3 + "/site-replication/edit",
10031003
content: encBytes,
10041004
queryValues: q,
10051005
}
@@ -1031,7 +1031,7 @@ func (adm *AdminClient) SRPeerEdit(ctx context.Context, pi PeerInfo) error {
10311031
q.Set("api-version", SiteReplAPIVersion)
10321032

10331033
reqData := requestData{
1034-
relPath: adminAPIPrefix + "/site-replication/peer/edit",
1034+
relPath: adminAPIPrefixV3 + "/site-replication/peer/edit",
10351035
content: b,
10361036
queryValues: q,
10371037
}
@@ -1061,7 +1061,7 @@ func (adm *AdminClient) SRStateEdit(ctx context.Context, state SRStateEditReq) e
10611061
q.Set("api-version", SiteReplAPIVersion)
10621062

10631063
reqData := requestData{
1064-
relPath: adminAPIPrefix + "/site-replication/state/edit",
1064+
relPath: adminAPIPrefixV3 + "/site-replication/state/edit",
10651065
content: b,
10661066
queryValues: q,
10671067
}
@@ -1089,7 +1089,7 @@ func (adm *AdminClient) SiteReplicationRemove(ctx context.Context, removeReq SRR
10891089
q.Set("api-version", SiteReplAPIVersion)
10901090

10911091
reqData := requestData{
1092-
relPath: adminAPIPrefix + "/site-replication/remove",
1092+
relPath: adminAPIPrefixV3 + "/site-replication/remove",
10931093
content: rmvBytes,
10941094
queryValues: q,
10951095
}
@@ -1119,7 +1119,7 @@ func (adm *AdminClient) SRPeerRemove(ctx context.Context, removeReq SRRemoveReq)
11191119
q.Set("api-version", SiteReplAPIVersion)
11201120

11211121
reqData := requestData{
1122-
relPath: adminAPIPrefix + "/site-replication/peer/remove",
1122+
relPath: adminAPIPrefixV3 + "/site-replication/peer/remove",
11231123
content: reqBytes,
11241124
queryValues: q,
11251125
}
@@ -1206,7 +1206,7 @@ func (adm *AdminClient) SiteReplicationResyncOp(ctx context.Context, site PeerIn
12061206
v.Set("api-version", SiteReplAPIVersion)
12071207

12081208
reqData := requestData{
1209-
relPath: adminAPIPrefix + "/site-replication/resync/op",
1209+
relPath: adminAPIPrefixV3 + "/site-replication/resync/op",
12101210
content: reqBytes,
12111211
queryValues: v,
12121212
}

config-commands.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (adm *AdminClient) GetConfig(ctx context.Context) ([]byte, error) {
3131
// Execute GET on /minio/admin/v3/config to get config of a setup.
3232
resp, err := adm.executeMethod(ctx,
3333
http.MethodGet,
34-
requestData{relPath: adminAPIPrefix + "/config"})
34+
requestData{relPath: adminAPIPrefixV3 + "/config"})
3535
defer closeResponse(resp)
3636
if err != nil {
3737
return nil, err
@@ -64,7 +64,7 @@ func (adm *AdminClient) SetConfig(ctx context.Context, config io.Reader) (err er
6464
}
6565

6666
reqData := requestData{
67-
relPath: adminAPIPrefix + "/config",
67+
relPath: adminAPIPrefixV3 + "/config",
6868
content: econfigBytes,
6969
}
7070

config-help-commands.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (adm *AdminClient) HelpConfigKV(ctx context.Context, subSys, key string, en
6666
}
6767

6868
reqData := requestData{
69-
relPath: adminAPIPrefix + "/help-config-kv",
69+
relPath: adminAPIPrefixV3 + "/help-config-kv",
7070
queryValues: v,
7171
}
7272

config-history-commands.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (adm *AdminClient) ClearConfigHistoryKV(ctx context.Context, restoreID stri
3535
v := url.Values{}
3636
v.Set("restoreId", restoreID)
3737
reqData := requestData{
38-
relPath: adminAPIPrefix + "/clear-config-history-kv",
38+
relPath: adminAPIPrefixV3 + "/clear-config-history-kv",
3939
queryValues: v,
4040
}
4141

@@ -60,7 +60,7 @@ func (adm *AdminClient) RestoreConfigHistoryKV(ctx context.Context, restoreID st
6060
v := url.Values{}
6161
v.Set("restoreId", restoreID)
6262
reqData := requestData{
63-
relPath: adminAPIPrefix + "/restore-config-history-kv",
63+
relPath: adminAPIPrefixV3 + "/restore-config-history-kv",
6464
queryValues: v,
6565
}
6666

@@ -104,7 +104,7 @@ func (adm *AdminClient) ListConfigHistoryKV(ctx context.Context, count int) ([]C
104104
resp, err := adm.executeMethod(ctx,
105105
http.MethodGet,
106106
requestData{
107-
relPath: adminAPIPrefix + "/list-config-history-kv",
107+
relPath: adminAPIPrefixV3 + "/list-config-history-kv",
108108
queryValues: v,
109109
})
110110
defer closeResponse(resp)

0 commit comments

Comments
 (0)