2015-09-19 04:30:09 -04:00
|
|
|
/*
|
|
|
|
* Minio Cloud Storage, (C) 2014 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 main
|
|
|
|
|
2015-09-20 20:12:45 -04:00
|
|
|
//// In memory metadata
|
|
|
|
|
2015-09-20 15:27:40 -04:00
|
|
|
//// RPC params
|
|
|
|
|
|
|
|
// AuthArgs auth params
|
|
|
|
type AuthArgs struct {
|
|
|
|
User string `json:"user"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// DonutArgs collections of disks and name to initialize donut
|
|
|
|
type DonutArgs struct {
|
|
|
|
Name string
|
|
|
|
MaxSize uint64
|
|
|
|
Hostname string
|
|
|
|
Disks []string
|
2015-09-19 04:30:09 -04:00
|
|
|
}
|
|
|
|
|
2015-09-20 20:12:45 -04:00
|
|
|
// ServerArg server params
|
|
|
|
type ServerArg struct{}
|
|
|
|
|
|
|
|
// ControllerArgs controller params
|
|
|
|
type ControllerArgs struct {
|
2015-09-22 03:44:41 -04:00
|
|
|
Host string `json:"host"` // host or host:port
|
|
|
|
SSL bool `json:"ssl"`
|
|
|
|
ID string `json:"id"`
|
2015-09-19 04:30:09 -04:00
|
|
|
}
|
|
|
|
|
2015-09-20 15:27:40 -04:00
|
|
|
//// RPC replies
|
|
|
|
|
2015-09-19 23:52:57 -04:00
|
|
|
// ServerRep server reply container for Server.List
|
2015-09-19 04:30:09 -04:00
|
|
|
type ServerRep struct {
|
2015-09-20 20:12:45 -04:00
|
|
|
Host string `json:"host"`
|
|
|
|
ID string `json:"id"`
|
2015-09-19 04:30:09 -04:00
|
|
|
}
|
|
|
|
|
2015-09-19 23:52:57 -04:00
|
|
|
// DefaultRep default reply
|
2015-09-19 04:30:09 -04:00
|
|
|
type DefaultRep struct {
|
2015-09-20 15:27:40 -04:00
|
|
|
Error error `json:"error"`
|
2015-09-19 04:30:09 -04:00
|
|
|
Message string `json:"message"`
|
|
|
|
}
|
|
|
|
|
2015-09-19 23:52:57 -04:00
|
|
|
// ServerListRep collection of server replies
|
2015-09-19 04:30:09 -04:00
|
|
|
type ServerListRep struct {
|
2015-09-22 04:31:20 -04:00
|
|
|
List []ServerRep `json:"list"`
|
2015-09-19 04:30:09 -04:00
|
|
|
}
|
|
|
|
|
2015-09-19 23:52:57 -04:00
|
|
|
// DiskStatsRep collection of disks
|
2015-09-19 04:30:09 -04:00
|
|
|
type DiskStatsRep struct {
|
2015-09-22 04:31:20 -04:00
|
|
|
Disks []string `json:"disks"`
|
2015-09-19 04:30:09 -04:00
|
|
|
}
|
|
|
|
|
2015-09-19 23:52:57 -04:00
|
|
|
// MemStatsRep memory statistics of a server
|
2015-09-19 04:30:09 -04:00
|
|
|
type MemStatsRep struct {
|
|
|
|
Total uint64 `json:"total"`
|
|
|
|
Free uint64 `json:"free"`
|
|
|
|
}
|
|
|
|
|
2015-09-20 20:12:45 -04:00
|
|
|
// Network metadata of a server
|
|
|
|
type Network struct {
|
|
|
|
IP string `json:"address"`
|
|
|
|
NetMask string `json:"netmask"`
|
|
|
|
Hostname string `json:"hostname"`
|
|
|
|
Ethernet string `json:"networkInterface"`
|
|
|
|
}
|
|
|
|
|
2015-09-19 23:52:57 -04:00
|
|
|
// NetStatsRep network statistics of a server
|
2015-09-19 04:30:09 -04:00
|
|
|
type NetStatsRep struct {
|
2015-09-22 04:31:20 -04:00
|
|
|
Interfaces []Network `json:"interfaces"`
|
2015-09-19 04:30:09 -04:00
|
|
|
}
|
|
|
|
|
2015-09-19 23:52:57 -04:00
|
|
|
// SysInfoRep system information of a server
|
2015-09-19 04:30:09 -04:00
|
|
|
type SysInfoRep struct {
|
|
|
|
Hostname string `json:"hostname"`
|
2015-09-19 23:52:57 -04:00
|
|
|
SysARCH string `json:"sysArch"`
|
|
|
|
SysOS string `json:"sysOS"`
|
|
|
|
SysCPUS int `json:"sysNcpus"`
|
|
|
|
Routines int `json:"goRoutines"`
|
|
|
|
GOVersion string `json:"goVersion"`
|
2015-09-19 04:30:09 -04:00
|
|
|
}
|
|
|
|
|
2015-09-19 23:52:57 -04:00
|
|
|
// ListRep all servers list
|
2015-09-19 04:30:09 -04:00
|
|
|
type ListRep struct {
|
2015-09-20 20:12:45 -04:00
|
|
|
List []ServerRep `json:"list"`
|
2015-09-19 04:30:09 -04:00
|
|
|
}
|
2015-09-19 23:52:57 -04:00
|
|
|
|
|
|
|
// VersionRep version reply
|
|
|
|
type VersionRep struct {
|
|
|
|
Version string `json:"version"`
|
|
|
|
BuildDate string `json:"buildDate"`
|
|
|
|
Architecture string `json:"arch"`
|
|
|
|
OperatingSystem string `json:"os"`
|
|
|
|
}
|
2015-09-20 15:27:40 -04:00
|
|
|
|
|
|
|
// AuthRep reply with access keys and secret ids for the user
|
|
|
|
type AuthRep struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
AccessKeyID string `json:"accessKeyId"`
|
|
|
|
SecretAccessKey string `json:"secretAccessKey"`
|
|
|
|
}
|