Documentation ¶
Overview ¶
Copyright 2016 The Rook Authors. All rights reserved.
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.
Copyright 2016 The Rook Authors. All rights reserved.
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.
Copyright 2016 The Rook Authors. All rights reserved.
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.
Copyright 2016 The Rook Authors. All rights reserved.
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.
Index ¶
- Constants
- Variables
- func DiscoverHardware(nodeID string, etcdClient etcd.KeysAPI, executor exec.Executor) error
- func DiskTypeToStr(diskType DiskType) string
- func GetDeviceFromUUID(uuid, nodeID string, etcdClient etcd.KeysAPI) (string, error)
- func GetDeviceSize(name, nodeID string, etcdClient etcd.KeysAPI) (uint64, error)
- func GetDeviceUUID(device, nodeID string, etcdClient etcd.KeysAPI) (string, error)
- func GetNodeConfigKey(nodeID string) string
- func GetNodeIDSet(c *Config) *util.Set
- func SetDeviceUUID(nodeID, device, uuid string, etcdClient etcd.KeysAPI) error
- func SetIPAddress(etcdClient etcd.KeysAPI, nodeId, publicIP, privateIP string) error
- func SetLocation(etcdClient etcd.KeysAPI, nodeId, location string) error
- func TriggerClusterHardwareDetection(etcdClient etcd.KeysAPI)
- type Config
- type DiskConfig
- type DiskType
- type MemoryConfig
- type NetworkConfig
- type NodeConfig
- type ProcessorConfig
Constants ¶
const ( MemoryTotalSizeKey = "total" NetworkIPv4AddressKey = "ipv4" NetworkIPv6AddressKey = "ipv6" NetworkSpeedKey = "speed" ProcPhysicalIDKey = "physical-id" ProcSiblingsKey = "siblings" ProcCoreIDKey = "core-id" ProcNumCoresKey = "cores" ProcSpeedKey = "speed" ProcBitsKey = "arch" Disk DiskType = iota Part )
const ( NodesHealthKey = "/rook/nodes/health" NodesConfigKey = "/rook/nodes/config" TriggerHardwareDetectionKey = "trigger-hardware-detection" )
const (
HeartbeatKey = "heartbeat"
)
Variables ¶
var (
HeartbeatTtlDuration = time.Duration(heartbeatTtlSeconds) * time.Second
)
Functions ¶
func DiscoverHardware ¶
func DiskTypeToStr ¶
func GetDeviceFromUUID ¶
func GetDeviceSize ¶
func GetDeviceUUID ¶
func GetNodeConfigKey ¶
gets the key under which all node hardware/config will be stored
func SetIPAddress ¶
Set the IP address for a node
Types ¶
type Config ¶
type Config struct {
Nodes map[string]*NodeConfig `json:"nodes"`
}
func CreateConfig ¶
Helper to create a Config with a set of node IDs
type DiskConfig ¶
type DiskConfig struct { Name string `json:"name"` UUID string `json:"uuid"` Size uint64 `json:"size"` Rotational bool `json:"rotational"` Readonly bool `json:"readonly"` FileSystem string `json:"fileSystem"` MountPoint string `json:"mountPoint"` Type DiskType `json:"type"` Parent string `json:"parent"` HasChildren bool `json:"hasChildren"` }
type MemoryConfig ¶
type MemoryConfig struct {
TotalSize uint64 `json:"totalSize"`
}
type NetworkConfig ¶
type NodeConfig ¶
type NodeConfig struct { Disks []DiskConfig `json:"disks"` Processors []ProcessorConfig `json:"processors"` Memory MemoryConfig `json:"memory"` NetworkAdapters []NetworkConfig `json:"networkAdapters"` PublicIP string `json:"publicIp"` PrivateIP string `json:"privateIp"` HeartbeatAge time.Duration `json:"heartbeatAge"` Location string `json:"location"` }