|
|
@ -54,12 +54,9 @@ const ( |
|
|
|
maxEConfigJSONSize = 262272 |
|
|
|
maxEConfigJSONSize = 262272 |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// Type-safe query params.
|
|
|
|
|
|
|
|
type mgmtQueryKey string |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Only valid query params for mgmt admin APIs.
|
|
|
|
// Only valid query params for mgmt admin APIs.
|
|
|
|
const ( |
|
|
|
const ( |
|
|
|
mgmtBucket mgmtQueryKey = "bucket" |
|
|
|
mgmtBucket = "bucket" |
|
|
|
mgmtPrefix = "prefix" |
|
|
|
mgmtPrefix = "prefix" |
|
|
|
mgmtClientToken = "clientToken" |
|
|
|
mgmtClientToken = "clientToken" |
|
|
|
mgmtForceStart = "forceStart" |
|
|
|
mgmtForceStart = "forceStart" |
|
|
@ -572,8 +569,8 @@ type healInitParams struct { |
|
|
|
|
|
|
|
|
|
|
|
// extractHealInitParams - Validates params for heal init API.
|
|
|
|
// extractHealInitParams - Validates params for heal init API.
|
|
|
|
func extractHealInitParams(vars map[string]string, qParms url.Values, r io.Reader) (hip healInitParams, err APIErrorCode) { |
|
|
|
func extractHealInitParams(vars map[string]string, qParms url.Values, r io.Reader) (hip healInitParams, err APIErrorCode) { |
|
|
|
hip.bucket = vars[string(mgmtBucket)] |
|
|
|
hip.bucket = vars[mgmtBucket] |
|
|
|
hip.objPrefix = vars[string(mgmtPrefix)] |
|
|
|
hip.objPrefix = vars[mgmtPrefix] |
|
|
|
|
|
|
|
|
|
|
|
if hip.bucket == "" { |
|
|
|
if hip.bucket == "" { |
|
|
|
if hip.objPrefix != "" { |
|
|
|
if hip.objPrefix != "" { |
|
|
@ -592,13 +589,13 @@ func extractHealInitParams(vars map[string]string, qParms url.Values, r io.Reade |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if len(qParms[string(mgmtClientToken)]) > 0 { |
|
|
|
if len(qParms[mgmtClientToken]) > 0 { |
|
|
|
hip.clientToken = qParms[string(mgmtClientToken)][0] |
|
|
|
hip.clientToken = qParms[mgmtClientToken][0] |
|
|
|
} |
|
|
|
} |
|
|
|
if _, ok := qParms[string(mgmtForceStart)]; ok { |
|
|
|
if _, ok := qParms[mgmtForceStart]; ok { |
|
|
|
hip.forceStart = true |
|
|
|
hip.forceStart = true |
|
|
|
} |
|
|
|
} |
|
|
|
if _, ok := qParms[string(mgmtForceStop)]; ok { |
|
|
|
if _, ok := qParms[mgmtForceStop]; ok { |
|
|
|
hip.forceStop = true |
|
|
|
hip.forceStop = true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|