|
|
|
@ -60,7 +60,7 @@ var ( |
|
|
|
|
// Returns Administration API version
|
|
|
|
|
func (a adminAPIHandlers) VersionHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
|
|
|
|
|
adminAPIErr := checkRequestAuthType(r, "", "", "") |
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, globalServerConfig.GetRegion()) |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponse(w, adminAPIErr, r.URL) |
|
|
|
|
return |
|
|
|
@ -80,7 +80,7 @@ func (a adminAPIHandlers) VersionHandler(w http.ResponseWriter, r *http.Request) |
|
|
|
|
// ----------
|
|
|
|
|
// Returns server version and uptime.
|
|
|
|
|
func (a adminAPIHandlers) ServiceStatusHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, "") |
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, globalServerConfig.GetRegion()) |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponseJSON(w, adminAPIErr, r.URL) |
|
|
|
|
return |
|
|
|
@ -125,7 +125,7 @@ func (a adminAPIHandlers) ServiceStatusHandler(w http.ResponseWriter, r *http.Re |
|
|
|
|
// Restarts/Stops minio server gracefully. In a distributed setup,
|
|
|
|
|
// restarts all the servers in the cluster.
|
|
|
|
|
func (a adminAPIHandlers) ServiceStopNRestartHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, "") |
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, globalServerConfig.GetRegion()) |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponseJSON(w, adminAPIErr, r.URL) |
|
|
|
|
return |
|
|
|
@ -217,7 +217,7 @@ type ServerInfo struct { |
|
|
|
|
// Get server information
|
|
|
|
|
func (a adminAPIHandlers) ServerInfoHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
// Authenticate request
|
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, "") |
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, globalServerConfig.GetRegion()) |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponseJSON(w, adminAPIErr, r.URL) |
|
|
|
|
return |
|
|
|
@ -304,7 +304,7 @@ func validateLockQueryParams(vars url.Values) (string, string, time.Duration, |
|
|
|
|
// Lists locks held on a given bucket, prefix and duration it was held for.
|
|
|
|
|
func (a adminAPIHandlers) ListLocksHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
|
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, "") |
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, globalServerConfig.GetRegion()) |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponseJSON(w, adminAPIErr, r.URL) |
|
|
|
|
return |
|
|
|
@ -347,7 +347,7 @@ func (a adminAPIHandlers) ListLocksHandler(w http.ResponseWriter, r *http.Reques |
|
|
|
|
// Clear locks held on a given bucket, prefix and duration it was held for.
|
|
|
|
|
func (a adminAPIHandlers) ClearLocksHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
|
|
|
|
|
adminAPIErr := checkRequestAuthType(r, "", "", "") |
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, globalServerConfig.GetRegion()) |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponseJSON(w, adminAPIErr, r.URL) |
|
|
|
|
return |
|
|
|
@ -453,7 +453,7 @@ func (a adminAPIHandlers) HealHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Validate request signature.
|
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, "") |
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, globalServerConfig.GetRegion()) |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponseJSON(w, adminAPIErr, r.URL) |
|
|
|
|
return |
|
|
|
@ -563,7 +563,7 @@ func (a adminAPIHandlers) HealHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
func (a adminAPIHandlers) GetConfigHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
|
|
|
|
|
// Validate request signature.
|
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, "") |
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, globalServerConfig.GetRegion()) |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponseJSON(w, adminAPIErr, r.URL) |
|
|
|
|
return |
|
|
|
@ -669,7 +669,7 @@ func (a adminAPIHandlers) SetConfigHandler(w http.ResponseWriter, r *http.Reques |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Validate request signature.
|
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, "") |
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, globalServerConfig.GetRegion()) |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponseJSON(w, adminAPIErr, r.URL) |
|
|
|
|
return |
|
|
|
@ -766,7 +766,7 @@ func (a adminAPIHandlers) UpdateCredentialsHandler(w http.ResponseWriter, |
|
|
|
|
r *http.Request) { |
|
|
|
|
|
|
|
|
|
// Authenticate request
|
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, "") |
|
|
|
|
adminAPIErr := checkAdminRequestAuthType(r, globalServerConfig.GetRegion()) |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponse(w, adminAPIErr, r.URL) |
|
|
|
|
return |
|
|
|
|