2020-10-04 13:18:46 -04:00
|
|
|
// +build !linux
|
2020-07-01 13:57:23 -04:00
|
|
|
|
2021-04-18 15:41:13 -04:00
|
|
|
// Copyright (c) 2015-2021 MinIO, Inc.
|
|
|
|
//
|
|
|
|
// This file is part of MinIO Object Storage stack
|
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU Affero General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2020-03-27 00:07:39 -04:00
|
|
|
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2020-05-18 12:59:45 -04:00
|
|
|
"net/http"
|
2020-07-01 13:57:23 -04:00
|
|
|
"runtime"
|
2020-03-27 00:07:39 -04:00
|
|
|
|
|
|
|
"github.com/minio/minio/pkg/madmin"
|
|
|
|
)
|
|
|
|
|
2020-11-20 15:52:53 -05:00
|
|
|
func getLocalDiskHwInfo(ctx context.Context, r *http.Request) madmin.ServerDiskHwInfo {
|
2020-05-18 12:59:45 -04:00
|
|
|
addr := r.Host
|
2020-06-12 23:04:01 -04:00
|
|
|
if globalIsDistErasure {
|
2021-03-26 14:37:58 -04:00
|
|
|
addr = globalLocalNodeName
|
2020-03-27 00:07:39 -04:00
|
|
|
}
|
|
|
|
|
2020-11-20 15:52:53 -05:00
|
|
|
return madmin.ServerDiskHwInfo{
|
2020-03-27 00:07:39 -04:00
|
|
|
Addr: addr,
|
2020-07-01 13:57:23 -04:00
|
|
|
Error: "unsupported platform: " + runtime.GOOS,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-20 15:52:53 -05:00
|
|
|
func getLocalOsInfo(ctx context.Context, r *http.Request) madmin.ServerOsInfo {
|
2020-07-01 13:57:23 -04:00
|
|
|
addr := r.Host
|
|
|
|
if globalIsDistErasure {
|
2021-03-26 14:37:58 -04:00
|
|
|
addr = globalLocalNodeName
|
2020-07-01 13:57:23 -04:00
|
|
|
}
|
|
|
|
|
2020-11-20 15:52:53 -05:00
|
|
|
return madmin.ServerOsInfo{
|
2020-07-01 13:57:23 -04:00
|
|
|
Addr: addr,
|
|
|
|
Error: "unsupported platform: " + runtime.GOOS,
|
2020-03-27 00:07:39 -04:00
|
|
|
}
|
|
|
|
}
|