@ -132,6 +132,22 @@ func (s *storageRESTServer) DiskInfoHandler(w http.ResponseWriter, r *http.Reque
gob . NewEncoder ( w ) . Encode ( info )
}
// GetDiskIDHandler - returns disk id.
func ( s * storageRESTServer ) GetDiskIDHandler ( w http . ResponseWriter , r * http . Request ) {
if err := storageServerRequestValidate ( r ) ; err != nil {
s . writeErrorResponse ( w , err )
return
}
info , err := s . storage . GetDiskID ( )
if err != nil {
s . writeErrorResponse ( w , err )
return
}
defer w . ( http . Flusher ) . Flush ( )
gob . NewEncoder ( w ) . Encode ( info )
}
func ( s * storageRESTServer ) CrawlAndGetDataUsageHandler ( w http . ResponseWriter , r * http . Request ) {
if ! s . IsValid ( w , r ) {
return
@ -784,6 +800,7 @@ func registerStorageRESTHandlers(router *mux.Router, endpointZones EndpointZones
subrouter := router . PathPrefix ( path . Join ( storageRESTPrefix , endpoint . Path ) ) . Subrouter ( )
subrouter . Methods ( http . MethodPost ) . Path ( storageRESTVersionPrefix + storageRESTMethodDiskInfo ) . HandlerFunc ( httpTraceHdrs ( server . DiskInfoHandler ) )
subrouter . Methods ( http . MethodPost ) . Path ( storageRESTVersionPrefix + storageRESTMethodGetDiskID ) . HandlerFunc ( httpTraceHdrs ( server . GetDiskIDHandler ) )
subrouter . Methods ( http . MethodPost ) . Path ( storageRESTVersionPrefix + storageRESTMethodCrawlAndGetDataUsage ) . HandlerFunc ( httpTraceHdrs ( server . CrawlAndGetDataUsageHandler ) )
subrouter . Methods ( http . MethodPost ) . Path ( storageRESTVersionPrefix + storageRESTMethodMakeVol ) . HandlerFunc ( httpTraceHdrs ( server . MakeVolHandler ) ) . Queries ( restQueries ( storageRESTVolume ) ... )
subrouter . Methods ( http . MethodPost ) . Path ( storageRESTVersionPrefix + storageRESTMethodMakeVolBulk ) . HandlerFunc ( httpTraceHdrs ( server . MakeVolBulkHandler ) ) . Queries ( restQueries ( storageRESTVolumes ) ... )