Documentation
¶
Overview ¶
Package state for grid state
Package state for grid state
Index ¶
- Variables
- type ContractIDs
- type DeploymentHostIDs
- type Network
- func (n *Network) DeleteDeploymentHostIDs(nodeID uint32, contractID uint64)
- func (n *Network) GetDeploymentHostIDs(nodeID uint32, contractID uint64) []byte
- func (n *Network) GetNodeSubnet(nodeID uint32) string
- func (n *Network) GetUsedNetworkHostIDs(nodeID uint32) []byte
- func (n *Network) SetDeploymentHostIDs(nodeID uint32, contractID uint64, ips []byte)
- func (n *Network) SetNodeSubnet(nodeID uint32, subnet string)
- type NetworkState
- type NodeDeploymentHostIDs
- type State
- func (st *State) AssignNodesIPRange(k *workloads.K8sCluster) (err error)
- func (st *State) GetWorkloadInDeployment(nodeID uint32, name string, deploymentName string) (gridtypes.Workload, gridtypes.Deployment, error)
- func (st *State) LoadDeploymentFromGrid(nodeID uint32, name string) (workloads.Deployment, error)
- func (st *State) LoadDiskFromGrid(nodeID uint32, name string, deploymentName string) (workloads.Disk, error)
- func (st *State) LoadGatewayFQDNFromGrid(nodeID uint32, name string, deploymentName string) (workloads.GatewayFQDNProxy, error)
- func (st *State) LoadGatewayNameFromGrid(nodeID uint32, name string, deploymentName string) (workloads.GatewayNameProxy, error)
- func (st *State) LoadK8sFromGrid(nodeIDs []uint32, deploymentName string) (workloads.K8sCluster, error)
- func (st *State) LoadNetworkFromGrid(name string) (znet workloads.ZNet, err error)
- func (st *State) LoadQSFSFromGrid(nodeID uint32, name string, deploymentName string) (workloads.QSFS, error)
- func (st *State) LoadVMFromGrid(nodeID uint32, name string, deploymentName string) (workloads.VM, error)
- func (st *State) LoadZdbFromGrid(nodeID uint32, name string, deploymentName string) (workloads.ZDB, error)
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
ErrNotFound for state not found instances
Functions ¶
This section is empty.
Types ¶
type DeploymentHostIDs ¶
DeploymentHostIDs is a map for deployment and its IPs
type Network ¶
type Network struct {
Subnets map[uint32]string
NodeDeploymentHostIDs NodeDeploymentHostIDs
}
Network struct includes Subnets and node IPs
func (*Network) DeleteDeploymentHostIDs ¶
DeleteDeploymentHostIDs deletes a deployment host IDs
func (*Network) GetDeploymentHostIDs ¶
GetDeploymentHostIDs gets the private Network host IDs relevant to the deployment
func (*Network) GetNodeSubnet ¶
GetNodeSubnet gets a node subnet using its ID
func (*Network) GetUsedNetworkHostIDs ¶
GetUsedNetworkHostIDs gets the used host IDs on the overlay Network
func (*Network) SetDeploymentHostIDs ¶
SetDeploymentHostIDs sets the relevant deployment host IDs
func (*Network) SetNodeSubnet ¶
SetNodeSubnet sets a node subnet with its ID and subnet
type NetworkState ¶
NetworkState is a map of of names and their networks
func (NetworkState) DeleteNetwork ¶
func (nm NetworkState) DeleteNetwork(networkName string)
DeleteNetwork deletes a Network using its name
func (NetworkState) GetNetwork ¶
func (nm NetworkState) GetNetwork(networkName string) Network
GetNetwork get a Network using its name
func (NetworkState) UpdateNetworkSubnets ¶
func (nm NetworkState) UpdateNetworkSubnets(networkName string, ipRange map[uint32]gridtypes.IPNet)
UpdateNetworkSubnets updates a network subnets given its name
type NodeDeploymentHostIDs ¶
type NodeDeploymentHostIDs map[uint32]DeploymentHostIDs
NodeDeploymentHostIDs is a map for nodes ID and its deployments' IPs
type State ¶
type State struct {
CurrentNodeDeployments map[uint32]ContractIDs
Networks NetworkState
NcPool client.NodeClientGetter
Substrate subi.SubstrateExt
}
State struct
func NewState ¶
func NewState(ncPool client.NodeClientGetter, substrate subi.SubstrateExt) *State
NewState generates a new state
func (*State) AssignNodesIPRange ¶
func (st *State) AssignNodesIPRange(k *workloads.K8sCluster) (err error)
AssignNodesIPRange to assign ip range of k8s cluster nodes
func (*State) GetWorkloadInDeployment ¶
func (st *State) GetWorkloadInDeployment(nodeID uint32, name string, deploymentName string) (gridtypes.Workload, gridtypes.Deployment, error)
GetWorkloadInDeployment return a workload in a deployment using their names and node ID if name is empty it returns a deployment with name equal to deploymentName and empty workload
func (*State) LoadDeploymentFromGrid ¶
LoadDeploymentFromGrid loads deployment from grid
func (*State) LoadDiskFromGrid ¶
func (st *State) LoadDiskFromGrid(nodeID uint32, name string, deploymentName string) (workloads.Disk, error)
LoadDiskFromGrid loads a disk from grid
func (*State) LoadGatewayFQDNFromGrid ¶
func (st *State) LoadGatewayFQDNFromGrid(nodeID uint32, name string, deploymentName string) (workloads.GatewayFQDNProxy, error)
LoadGatewayFQDNFromGrid loads a gateway FQDN proxy from grid
func (*State) LoadGatewayNameFromGrid ¶
func (st *State) LoadGatewayNameFromGrid(nodeID uint32, name string, deploymentName string) (workloads.GatewayNameProxy, error)
LoadGatewayNameFromGrid loads a gateway name proxy from grid
func (*State) LoadK8sFromGrid ¶
func (st *State) LoadK8sFromGrid(nodeIDs []uint32, deploymentName string) (workloads.K8sCluster, error)
LoadK8sFromGrid loads k8s from grid
func (*State) LoadNetworkFromGrid ¶
LoadNetworkFromGrid loads a network from grid
func (*State) LoadQSFSFromGrid ¶
func (st *State) LoadQSFSFromGrid(nodeID uint32, name string, deploymentName string) (workloads.QSFS, error)
LoadQSFSFromGrid loads a QSFS from grid