2020-10-04 19:18:46 +02:00
|
|
|
// +build !linux
|
2020-07-01 19:57:23 +02:00
|
|
|
|
2020-03-27 05:07:39 +01:00
|
|
|
/*
|
|
|
|
* MinIO Cloud Storage, (C) 2020 MinIO, Inc.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2020-05-18 18:59:45 +02:00
|
|
|
"net/http"
|
2020-07-01 19:57:23 +02:00
|
|
|
"runtime"
|
2020-03-27 05:07:39 +01:00
|
|
|
|
|
|
|
"github.com/minio/minio/pkg/madmin"
|
|
|
|
)
|
|
|
|
|
2020-11-20 21:52:53 +01:00
|
|
|
func getLocalDiskHwInfo(ctx context.Context, r *http.Request) madmin.ServerDiskHwInfo {
|
2020-05-18 18:59:45 +02:00
|
|
|
addr := r.Host
|
2020-06-13 05:04:01 +02:00
|
|
|
if globalIsDistErasure {
|
2021-03-26 19:37:58 +01:00
|
|
|
addr = globalLocalNodeName
|
2020-03-27 05:07:39 +01:00
|
|
|
}
|
|
|
|
|
2020-11-20 21:52:53 +01:00
|
|
|
return madmin.ServerDiskHwInfo{
|
2020-03-27 05:07:39 +01:00
|
|
|
Addr: addr,
|
2020-07-01 19:57:23 +02:00
|
|
|
Error: "unsupported platform: " + runtime.GOOS,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-20 21:52:53 +01:00
|
|
|
func getLocalOsInfo(ctx context.Context, r *http.Request) madmin.ServerOsInfo {
|
2020-07-01 19:57:23 +02:00
|
|
|
addr := r.Host
|
|
|
|
if globalIsDistErasure {
|
2021-03-26 19:37:58 +01:00
|
|
|
addr = globalLocalNodeName
|
2020-07-01 19:57:23 +02:00
|
|
|
}
|
|
|
|
|
2020-11-20 21:52:53 +01:00
|
|
|
return madmin.ServerOsInfo{
|
2020-07-01 19:57:23 +02:00
|
|
|
Addr: addr,
|
|
|
|
Error: "unsupported platform: " + runtime.GOOS,
|
2020-03-27 05:07:39 +01:00
|
|
|
}
|
|
|
|
}
|