luci: go.chromium.org/luci/machine-db/appengine/model Index | Files

package model

import "go.chromium.org/luci/machine-db/appengine/model"

Index

Package Files

datacenters.go hosts.go ips.go kvms.go oses.go platforms.go rack_kvms.go racks.go switches.go vlans.go

func AssignHostnameAndIP Uses

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 Uses

func EnsureDatacenters(c context.Context, cfgs []*config.Datacenter) (map[string]int64, error)

EnsureDatacenters ensures the database contains exactly the given datacenters. Returns a map of datacenter names to IDs in the database.

func EnsureIPs Uses

func EnsureIPs(c context.Context, cfgs []*config.VLAN) error

EnsureIPs ensures the database contains exactly the given IP addresses.

func EnsureKVMs Uses

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 Uses

func EnsureOSes(c context.Context, cfgs []*config.OS) error

EnsureOSes ensures the database contains exactly the given operating systems.

func EnsurePlatforms Uses

func EnsurePlatforms(c context.Context, cfgs []*config.Platform) (map[string]int64, error)

EnsurePlatforms ensures the database contains exactly the given platforms. Returns a map of platform names to IDs.

func EnsureRackKVMs Uses

func EnsureRackKVMs(c context.Context, cfgs []*config.Datacenter, kvmIds map[string]int64) error

EnsureRackKVMs ensures the database contains exactly the given rack kvm_ids.

func EnsureRacks Uses

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 Uses

func EnsureSwitches(c context.Context, cfgs []*config.Datacenter, rackIds map[string]int64) error

EnsureSwitches ensures the database contains exactly the given switches.

func EnsureVLANs Uses

func EnsureVLANs(c context.Context, cfgs []*config.VLAN) error

EnsureVLANs ensures the database contains exactly the given VLANs.

type Datacenter Uses

type Datacenter struct {
    config.Datacenter
    Id  int64
}

Datacenter represents a row in the datacenters table.

type DatacentersTable Uses

type DatacentersTable struct {
    // contains filtered or unexported fields
}

DatacentersTable represents the table of datacenters in the database.

type IP Uses

type IP struct {
    Id     int64
    IPv4   common.IPv4
    VLANId int64
}

IP represents a row in the ips table.

type IPsTable Uses

type IPsTable struct {
    // contains filtered or unexported fields
}

IPsTable represents the table of IP addresses in the database.

type KVM Uses

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 Uses

type KVMsTable struct {
    // contains filtered or unexported fields
}

KVMsTable represents the table of KVMs in the database.

type OS Uses

type OS struct {
    config.OS
    Id  int64
}

OS represents a row in the oses table.

type OSesTable Uses

type OSesTable struct {
    // contains filtered or unexported fields
}

OSesTable represents the table of operating systems in the database.

type Platform Uses

type Platform struct {
    config.Platform
    Id  int64
}

Platform represents a row in the platforms table.

type PlatformsTable Uses

type PlatformsTable struct {
    // contains filtered or unexported fields
}

PlatformsTable represents the table of platforms in the database.

type Rack Uses

type Rack struct {
    config.Rack
    DatacenterId int64
    Id           int64
}

Rack represents a row in the racks table.

type RackKVM Uses

type RackKVM struct {
    config.Rack
    Id    int64
    KVMId sql.NullInt64
}

RackKVM represents a kvm_id column in a row in the racks table.

type RackKVMsTable Uses

type RackKVMsTable struct {
    // contains filtered or unexported fields
}

RackKVMsTable represents the table of kvm_ids for racks in the database.

type RacksTable Uses

type RacksTable struct {
    // contains filtered or unexported fields
}

RacksTable represents the table of racks in the database.

type Switch Uses

type Switch struct {
    config.Switch
    RackId int64
    Id     int64
}

Switch represents a row in the switches table.

type SwitchesTable Uses

type SwitchesTable struct {
    // contains filtered or unexported fields
}

SwitchesTable represents the table of switches in the database.

type VLAN Uses

type VLAN struct {
    config.VLAN
}

VLAN represents a row in the vlans table.

type VLANsTable Uses

type VLANsTable struct {
    // contains filtered or unexported fields
}

VLANsTable represents the table of VLANs in the database.

Package model imports 12 packages (graph) and is imported by 2 packages. Updated 2018-12-14. Refresh now. Tools for package owners.