fix: change policies API to return and take struct (#9181)

This allows for order guarantees in returned values
can be consumed safely by the caller to avoid any
additional parsing and validation.

Fixes #9171
This commit is contained in:
Harshavardhana
2020-04-07 19:30:59 -07:00
committed by GitHub
parent e7276b7b9b
commit 2642e12d14
16 changed files with 323 additions and 239 deletions
+3 -3
View File
@@ -35,7 +35,7 @@ func (adm *AdminClient) DelConfigKV(ctx context.Context, k string) (err error) {
content: econfigBytes,
}
// Execute DELETE on /minio/admin/v2/del-config-kv to delete config key.
// Execute DELETE on /minio/admin/v3/del-config-kv to delete config key.
resp, err := adm.executeMethod(ctx, http.MethodDelete, reqData)
defer closeResponse(resp)
@@ -62,7 +62,7 @@ func (adm *AdminClient) SetConfigKV(ctx context.Context, kv string) (err error)
content: econfigBytes,
}
// Execute PUT on /minio/admin/v2/set-config-kv to set config key/value.
// Execute PUT on /minio/admin/v3/set-config-kv to set config key/value.
resp, err := adm.executeMethod(ctx, http.MethodPut, reqData)
defer closeResponse(resp)
@@ -82,7 +82,7 @@ func (adm *AdminClient) GetConfigKV(ctx context.Context, key string) (Targets, e
v := url.Values{}
v.Set("key", key)
// Execute GET on /minio/admin/v2/get-config-kv?key={key} to get value of key.
// Execute GET on /minio/admin/v3/get-config-kv?key={key} to get value of key.
resp, err := adm.executeMethod(ctx,
http.MethodGet,
requestData{