Documentation ¶
Index ¶
- func AssignHostnameAndIP(c context.Context, tx database.ExecerContext, hostname string, ...) (int64, error)
- func EnsureDatacenters(c context.Context, cfgs []*config.Datacenter) (map[string]int64, error)
- func EnsureIPs(c context.Context, cfgs []*config.VLAN) error
- func EnsureKVMs(c context.Context, cfgs []*config.Datacenter, ...) (map[string]int64, error)
- func EnsureOSes(c context.Context, cfgs []*config.OS) error
- func EnsurePlatforms(c context.Context, cfgs []*config.Platform) (map[string]int64, error)
- func EnsureRackKVMs(c context.Context, cfgs []*config.Datacenter, kvmIds map[string]int64) error
- func EnsureRacks(c context.Context, cfgs []*config.Datacenter, datacenterIds map[string]int64) (map[string]int64, error)
- func EnsureSwitches(c context.Context, cfgs []*config.Datacenter, rackIds map[string]int64) error
- func EnsureVLANs(c context.Context, cfgs []*config.VLAN) error
- type Datacenter
- type DatacentersTable
- type IP
- type IPsTable
- type KVM
- type KVMsTable
- type OS
- type OSesTable
- type Platform
- type PlatformsTable
- type Rack
- type RackKVM
- type RackKVMsTable
- type RacksTable
- type Switch
- type SwitchesTable
- type VLAN
- type VLANsTable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignHostnameAndIP ¶
func AssignHostnameAndIP(c context.Context, tx database.ExecerContext, hostname string, ipv4 common.IPv4) (int64, error)
AssignHostnameAndIP assigns the given hostname and IP address using the given transaction. The caller must commit or roll back the transaction appropriately.
func EnsureDatacenters ¶
EnsureDatacenters ensures the database contains exactly the given datacenters. Returns a map of datacenter names to IDs in the database.
func EnsureKVMs ¶
func EnsureKVMs(c context.Context, cfgs []*config.Datacenter, platformIds, rackIds map[string]int64) (map[string]int64, error)
EnsureKVMs ensures the database contains exactly the given KVMs. Returns a map of KVM names to IDs in the database.
func EnsureOSes ¶
EnsureOSes ensures the database contains exactly the given operating systems.
func EnsurePlatforms ¶
EnsurePlatforms ensures the database contains exactly the given platforms. Returns a map of platform names to IDs.
func EnsureRackKVMs ¶
EnsureRackKVMs ensures the database contains exactly the given rack kvm_ids.
func EnsureRacks ¶
func EnsureRacks(c context.Context, cfgs []*config.Datacenter, datacenterIds map[string]int64) (map[string]int64, error)
EnsureRacks ensures the database contains exactly the given racks. Returns a map of rack names to IDs in the database.
func EnsureSwitches ¶
EnsureSwitches ensures the database contains exactly the given switches.
func EnsureVLANs ¶
EnsureVLANs ensures the database contains exactly the given VLANs.
Types ¶
type Datacenter ¶
type Datacenter struct { config.Datacenter Id int64 }
Datacenter represents a row in the datacenters table.
type DatacentersTable ¶
type DatacentersTable struct {
// contains filtered or unexported fields
}
DatacentersTable represents the table of datacenters in the database.
type IPsTable ¶
type IPsTable struct {
// contains filtered or unexported fields
}
IPsTable represents the table of IP addresses in the database.
type KVM ¶
type KVM struct { config.KVM IPv4 common.IPv4 MacAddress common.MAC48 PlatformId int64 RackId int64 Id int64 HostnameId int64 }
KVM represents a row in the kvms table.
type KVMsTable ¶
type KVMsTable struct {
// contains filtered or unexported fields
}
KVMsTable represents the table of KVMs in the database.
type OSesTable ¶
type OSesTable struct {
// contains filtered or unexported fields
}
OSesTable represents the table of operating systems in the database.
type Platform ¶
type Platform struct { config.Platform Id int64 }
Platform represents a row in the platforms table.
type PlatformsTable ¶
type PlatformsTable struct {
// contains filtered or unexported fields
}
PlatformsTable represents the table of platforms in the database.
type RackKVMsTable ¶
type RackKVMsTable struct {
// contains filtered or unexported fields
}
RackKVMsTable represents the table of kvm_ids for racks in the database.
type RacksTable ¶
type RacksTable struct {
// contains filtered or unexported fields
}
RacksTable represents the table of racks in the database.
type SwitchesTable ¶
type SwitchesTable struct {
// contains filtered or unexported fields
}
SwitchesTable represents the table of switches in the database.
type VLANsTable ¶
type VLANsTable struct {
// contains filtered or unexported fields
}
VLANsTable represents the table of VLANs in the database.