Documentation ¶
Index ¶
- Constants
- type AutoParams
- type Cfg
- func (gc *Cfg) AllocSubnet(ra core.ResourceManager) (string, error)
- func (gc *Cfg) AllocVLAN(ra core.ResourceManager) (uint, error)
- func (gc *Cfg) AllocVXLAN(ra core.ResourceManager) (vxlan uint, localVLAN uint, err error)
- func (gc *Cfg) AssignDefaultNetwork(networkName string) (string, error)
- func (gc *Cfg) Clear() error
- func (gc *Cfg) Dump() error
- func (gc *Cfg) FreeSubnet(ra core.ResourceManager, subnetIP string) error
- func (gc *Cfg) FreeVLAN(ra core.ResourceManager, vlan uint) error
- func (gc *Cfg) FreeVXLAN(ra core.ResourceManager, vxlan uint, localVLAN uint) error
- func (gc *Cfg) Process(ra core.ResourceManager) error
- func (gc *Cfg) Read(tenant string) error
- func (gc *Cfg) ReadAll() ([]core.State, error)
- func (gc *Cfg) UnassignNetwork(networkName string) error
- func (gc *Cfg) Write() error
- type DeployParams
- type Oper
Constants ¶
const (
VersionBeta1 = "0.01"
)
Version constants. Used in managing state variance.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoParams ¶
type AutoParams struct { SubnetPool string `json:"subnetPool"` SubnetLen uint `json:"subnetLen"` AllocSubnetLen uint `json:"AllocSubnetLen"` VLANs string `json:"VLANs"` VXLANs string `json:"VXLANs"` }
AutoParams specifies various parameters for the auto allocation and resource management for networks and endpoints. This allows for hands-free allocation of resources without having to specify these each time these constructs gets created.
type Cfg ¶
type Cfg struct { core.CommonState Version string `json:"version"` Tenant string `json:"tenant"` Auto AutoParams `json:"auto"` Deploy DeployParams `json:"deploy"` NwInfraMode string `json:"nw-infra-mode"` }
Cfg is the configuration of a tenant.
func (*Cfg) AllocSubnet ¶
func (gc *Cfg) AllocSubnet(ra core.ResourceManager) (string, error)
AllocSubnet allocates a new subnet. Returns a CIDR.
func (*Cfg) AllocVLAN ¶
func (gc *Cfg) AllocVLAN(ra core.ResourceManager) (uint, error)
AllocVLAN allocates a new VLAN resource. Returns an ID.
func (*Cfg) AllocVXLAN ¶
AllocVXLAN allocates a new vxlan; ids for both the vxlan and vlan are returned.
func (*Cfg) AssignDefaultNetwork ¶
AssignDefaultNetwork assigns a default network for a tenant based on the configuration in case configuration is absent it uses the provided network name to be the default network. It records the default network in oper state (derived or configured)
func (*Cfg) FreeSubnet ¶
func (gc *Cfg) FreeSubnet(ra core.ResourceManager, subnetIP string) error
FreeSubnet releases a subnet derived from it's CIDR.
func (*Cfg) FreeVLAN ¶
func (gc *Cfg) FreeVLAN(ra core.ResourceManager, vlan uint) error
FreeVLAN releases a VLAN for a given ID.
func (*Cfg) Process ¶
func (gc *Cfg) Process(ra core.ResourceManager) error
Process validates, implements, and writes the state.
func (*Cfg) UnassignNetwork ¶
UnassignNetwork clears the oper state w.r.t. default network name
type DeployParams ¶
type DeployParams struct { DefaultNetType string `json:"defaultNetType"` DefaultNetwork string `json:"defaultNetwork"` }
DeployParams specifies parameters that decides the deployment choices