Documentation ¶
Index ¶
- Constants
- Variables
- func AssetRegistration(ctx context.Context, asset *ufspb.Asset) (*ufspb.Asset, error)
- func BatchGetChromePlatforms(ctx context.Context, ids []string) ([]*ufspb.ChromePlatform, error)
- func BatchGetDhcpConfigs(ctx context.Context, hostnames []string) ([]*ufspb.DHCPConfig, error)
- func BatchGetDracs(ctx context.Context, ids []string) ([]*ufspb.Drac, error)
- func BatchGetKVMs(ctx context.Context, ids []string) ([]*ufspb.KVM, error)
- func BatchGetMachineLSEDeployments(ctx context.Context, ids []string) ([]*ufspb.MachineLSEDeployment, error)
- func BatchGetMachineLSEPrototypes(ctx context.Context, ids []string) ([]*ufspb.MachineLSEPrototype, error)
- func BatchGetMachineLSEs(ctx context.Context, ids []string) ([]*ufspb.MachineLSE, error)
- func BatchGetMachines(ctx context.Context, ids []string) ([]*ufspb.Machine, error)
- func BatchGetNics(ctx context.Context, ids []string) ([]*ufspb.Nic, error)
- func BatchGetRPMs(ctx context.Context, ids []string) ([]*ufspb.RPM, error)
- func BatchGetRackLSEPrototypes(ctx context.Context, ids []string) ([]*ufspb.RackLSEPrototype, error)
- func BatchGetRacks(ctx context.Context, ids []string) ([]*ufspb.Rack, error)
- func BatchGetSwitches(ctx context.Context, ids []string) ([]*ufspb.Switch, error)
- func BatchGetVMs(ctx context.Context, ids []string) ([]*ufspb.VM, error)
- func BatchGetVlans(ctx context.Context, ids []string) ([]*ufspb.Vlan, error)
- func CreateCachingService(ctx context.Context, cs *ufspb.CachingService) (*ufspb.CachingService, error)
- func CreateChromePlatform(ctx context.Context, chromeplatform *ufspb.ChromePlatform) (*ufspb.ChromePlatform, error)
- func CreateDUT(ctx context.Context, machinelse *ufspb.MachineLSE) (*ufspb.MachineLSE, error)
- func CreateDrac(ctx context.Context, drac *ufspb.Drac) (*ufspb.Drac, error)
- func CreateKVM(ctx context.Context, kvm *ufspb.KVM) (*ufspb.KVM, error)
- func CreateLabstation(ctx context.Context, lse *ufspb.MachineLSE) (*ufspb.MachineLSE, error)
- func CreateMachineFromAsset(asset *ufspb.Asset) *ufspb.Machine
- func CreateMachineLSE(ctx context.Context, machinelse *ufspb.MachineLSE, nwOpt *ufsAPI.NetworkOption) (*ufspb.MachineLSE, error)
- func CreateMachineLSEPrototype(ctx context.Context, machinelseprototype *ufspb.MachineLSEPrototype) (*ufspb.MachineLSEPrototype, error)
- func CreateNic(ctx context.Context, nic *ufspb.Nic) (*ufspb.Nic, error)
- func CreateRPM(ctx context.Context, rpm *ufspb.RPM) (*ufspb.RPM, error)
- func CreateRackLSE(ctx context.Context, racklse *ufspb.RackLSE) (*ufspb.RackLSE, error)
- func CreateRackLSEPrototype(ctx context.Context, racklseprototype *ufspb.RackLSEPrototype) (*ufspb.RackLSEPrototype, error)
- func CreateSchedulingUnit(ctx context.Context, su *ufspb.SchedulingUnit) (*ufspb.SchedulingUnit, error)
- func CreateSwitch(ctx context.Context, s *ufspb.Switch) (*ufspb.Switch, error)
- func CreateVM(ctx context.Context, vm *ufspb.VM, nwOpt *ufsAPI.NetworkOption) (*ufspb.VM, error)
- func CreateVlan(ctx context.Context, vlan *ufspb.Vlan) (*ufspb.Vlan, error)
- func DeleteAsset(ctx context.Context, name string) error
- func DeleteCachingService(ctx context.Context, id string) error
- func DeleteChromePlatform(ctx context.Context, id string) error
- func DeleteDrac(ctx context.Context, id string) error
- func DeleteDracHost(ctx context.Context, dracName string) error
- func DeleteKVM(ctx context.Context, id string) error
- func DeleteKVMHost(ctx context.Context, kvmName string) error
- func DeleteMachine(ctx context.Context, id string) error
- func DeleteMachineLSE(ctx context.Context, id string) error
- func DeleteMachineLSEHost(ctx context.Context, machinelseName string) error
- func DeleteMachineLSEPrototype(ctx context.Context, id string) error
- func DeleteNic(ctx context.Context, id string) error
- func DeleteRPM(ctx context.Context, id string) error
- func DeleteRPMHost(ctx context.Context, rpmName string) error
- func DeleteRack(ctx context.Context, id string) error
- func DeleteRackLSE(ctx context.Context, id string) error
- func DeleteRackLSEPrototype(ctx context.Context, id string) error
- func DeleteSchedulingUnit(ctx context.Context, id string) error
- func DeleteSwitch(ctx context.Context, id string) error
- func DeleteVM(ctx context.Context, id string) error
- func DeleteVMHost(ctx context.Context, vmName string) error
- func DeleteVlan(ctx context.Context, id string) error
- func GetAllMachines(ctx context.Context) (*ufsds.OpResults, error)
- func GetAsset(ctx context.Context, name string) (*ufspb.Asset, error)
- func GetCachingService(ctx context.Context, id string) (*ufspb.CachingService, error)
- func GetChromeOSDeviceData(ctx context.Context, id, hostname string) (*ufspb.ChromeOSDeviceData, error)
- func GetChromePlatform(ctx context.Context, id string) (*ufspb.ChromePlatform, error)
- func GetDHCPConfig(ctx context.Context, hostname string) (*ufspb.DHCPConfig, error)
- func GetDUTConnectedToServo(ctx context.Context, servo *chromeosLab.Servo) (*ufspb.MachineLSE, error)
- func GetDrac(ctx context.Context, id string) (*ufspb.Drac, error)
- func GetDutState(ctx context.Context, id, hostname string) (*chromeosLab.DutState, error)
- func GetKVM(ctx context.Context, id string) (*ufspb.KVM, error)
- func GetMachine(ctx context.Context, id string) (*ufspb.Machine, error)
- func GetMachineLSE(ctx context.Context, id string) (*ufspb.MachineLSE, error)
- func GetMachineLSEDeployment(ctx context.Context, id string) (*ufspb.MachineLSEDeployment, error)
- func GetMachineLSEPrototype(ctx context.Context, id string) (*ufspb.MachineLSEPrototype, error)
- func GetNic(ctx context.Context, id string) (*ufspb.Nic, error)
- func GetRPM(ctx context.Context, id string) (*ufspb.RPM, error)
- func GetRack(ctx context.Context, id string) (*ufspb.Rack, error)
- func GetRackLSE(ctx context.Context, id string) (*ufspb.RackLSE, error)
- func GetRackLSEPrototype(ctx context.Context, id string) (*ufspb.RackLSEPrototype, error)
- func GetSchedulingUnit(ctx context.Context, id string) (*ufspb.SchedulingUnit, error)
- func GetState(ctx context.Context, resourceName string) (*ufspb.StateRecord, error)
- func GetSwitch(ctx context.Context, id string) (*ufspb.Switch, error)
- func GetVM(ctx context.Context, id string) (*ufspb.VM, error)
- func GetVlan(ctx context.Context, id string) (*ufspb.Vlan, error)
- func ImportChromePlatforms(ctx context.Context, platforms []*ufspb.ChromePlatform, pageSize int) (*ufsds.OpResults, error)
- func ImportDatacenter(ctx context.Context, dcs []*crimsonconfig.Datacenter, pageSize int) (*datastore.OpResults, error)
- func ImportDracs(ctx context.Context, dracs []*ufspb.Drac) (*ufsds.OpResults, error)
- func ImportMachineLSEs(ctx context.Context, hosts []*crimson.PhysicalHost, vms []*crimson.VM, ...) (*ufsds.OpResults, error)
- func ImportMachines(ctx context.Context, machines []*ufspb.Machine, pageSize int) (*ufsds.OpResults, error)
- func ImportNetworkInterfaces(ctx context.Context, nics []*crimson.NIC, dracs []*crimson.DRAC, ...) (*ufsds.OpResults, error)
- func ImportOSMachineLSEs(ctx context.Context, ...) (*ufsds.OpResults, error)
- func ImportOSVlans(ctx context.Context, sheetClient sheet.ClientInterface, ...) (*ufsds.OpResults, error)
- func ImportOSes(ctx context.Context, oses []*ufspb.OSVersion, pageSize int) (*ufsds.OpResults, error)
- func ImportStates(ctx context.Context, machines []*crimson.Machine, racks []*crimson.Rack, ...) (*ufsds.OpResults, error)
- func ImportVlans(ctx context.Context, vlans []*crimsonconfig.VLAN, pageSize int) (*ufsds.OpResults, error)
- func ListAssets(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.Asset, string, error)
- func ListCachingServices(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.CachingService, string, error)
- func ListChromePlatforms(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.ChromePlatform, string, error)
- func ListDracs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.Drac, string, error)
- func ListDutStates(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*chromeosLab.DutState, string, error)
- func ListKVMs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.KVM, string, error)
- func ListMachineLSEDeployments(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.MachineLSEDeployment, string, error)
- func ListMachineLSEPrototypes(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.MachineLSEPrototype, string, error)
- func ListMachineLSEs(ctx context.Context, pageSize int32, pageToken, filter string, ...) ([]*ufspb.MachineLSE, string, error)
- func ListMachines(ctx context.Context, pageSize int32, pageToken, filter string, ...) ([]*ufspb.Machine, string, error)
- func ListNics(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.Nic, string, error)
- func ListOSes(ctx context.Context, pageSize int32, pageToken string, filter string, ...) ([]*ufspb.OSVersion, string, error)
- func ListRPMs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.RPM, string, error)
- func ListRackLSEPrototypes(ctx context.Context, pageSize int32, pageToken string, filter string, ...) ([]*ufspb.RackLSEPrototype, string, error)
- func ListRackLSEs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.RackLSE, string, error)
- func ListRacks(ctx context.Context, pageSize int32, pageToken, filter string, ...) ([]*ufspb.Rack, string, error)
- func ListSchedulingUnits(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.SchedulingUnit, string, error)
- func ListSwitches(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.Switch, string, error)
- func ListVMs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.VM, string, error)
- func ListVlans(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.Vlan, string, error)
- func LogDHCPChanges(oldData, newData *ufspb.DHCPConfig) ([]*ufspb.ChangeEvent, *history.SnapshotMsgEntity)
- func LogIPChanges(oldData, newData *ufspb.IP) []*ufspb.ChangeEvent
- func LogStateChanges(oldData, newData *ufspb.StateRecord) ([]*ufspb.ChangeEvent, *history.SnapshotMsgEntity)
- func MachineRegistration(ctx context.Context, machine *ufspb.Machine) (*ufspb.Machine, error)
- func RackRegistration(ctx context.Context, rack *ufspb.Rack) (*ufspb.Rack, error)
- func RenameAsset(ctx context.Context, oldName, newName string) (res *ufspb.Asset, err error)
- func RenameMachine(ctx context.Context, oldMachineName, newMachineName string) (machine *ufspb.Machine, err error)
- func RenameMachineLSE(ctx context.Context, oldName, newName string) (*ufspb.MachineLSE, error)
- func RenameNic(ctx context.Context, oldNicName, newNicName string) (*ufspb.Nic, error)
- func RenameSwitch(ctx context.Context, oldSwitchName, newSwitchName string) (*ufspb.Switch, error)
- func ReplaceChromePlatform(ctx context.Context, oldChromePlatform *ufspb.ChromePlatform, ...) (*ufspb.ChromePlatform, error)
- func ReplaceDrac(ctx context.Context, oldDrac *ufspb.Drac, newDrac *ufspb.Drac) (*ufspb.Drac, error)
- func ReplaceKVM(ctx context.Context, oldKVM *ufspb.KVM, newKVM *ufspb.KVM) (*ufspb.KVM, error)
- func ReplaceMachine(ctx context.Context, oldMachine *ufspb.Machine, newMachine *ufspb.Machine) (*ufspb.Machine, error)
- func ReplaceMachineLSEPrototype(ctx context.Context, oldMachineLSEPrototype *ufspb.MachineLSEPrototype, ...) (*ufspb.MachineLSEPrototype, error)
- func ReplaceNic(ctx context.Context, oldNic *ufspb.Nic, newNic *ufspb.Nic) (*ufspb.Nic, error)
- func ReplaceRPM(ctx context.Context, oldRPM *ufspb.RPM, newRPM *ufspb.RPM) (*ufspb.RPM, error)
- func ReplaceRack(ctx context.Context, oldRack *ufspb.Rack, newRack *ufspb.Rack) (*ufspb.Rack, error)
- func ReplaceRackLSEPrototype(ctx context.Context, oldRackLSEPrototype *ufspb.RackLSEPrototype, ...) (*ufspb.RackLSEPrototype, error)
- func ReplaceSwitch(ctx context.Context, oldSwitch *ufspb.Switch, newSwitch *ufspb.Switch) (*ufspb.Switch, error)
- func ReplaceVlan(ctx context.Context, oldVlan *ufspb.Vlan, newVlan *ufspb.Vlan) (*ufspb.Vlan, error)
- func ResourceExist(ctx context.Context, resources []*Resource, errorMsg *strings.Builder) error
- func UpdateAsset(ctx context.Context, asset *ufspb.Asset, mask *field_mask.FieldMask) (*ufspb.Asset, error)
- func UpdateAssetMeta(ctx context.Context, meta *ufspb.DutMeta) error
- func UpdateCachingService(ctx context.Context, cs *ufspb.CachingService, mask *field_mask.FieldMask) (*ufspb.CachingService, error)
- func UpdateChromePlatform(ctx context.Context, chromeplatform *ufspb.ChromePlatform, ...) (*ufspb.ChromePlatform, error)
- func UpdateConfigBundle(ctx context.Context, cb []byte, mask *field_mask.FieldMask, allowMissing bool) ([]byte, error)
- func UpdateDUT(ctx context.Context, machinelse *ufspb.MachineLSE, mask *field_mask.FieldMask) (*ufspb.MachineLSE, error)
- func UpdateDrac(ctx context.Context, drac *ufspb.Drac, mask *field_mask.FieldMask) (*ufspb.Drac, error)
- func UpdateDracHost(ctx context.Context, drac *ufspb.Drac, nwOpt *ufsAPI.NetworkOption) error
- func UpdateDutMeta(ctx context.Context, meta *ufspb.DutMeta) error
- func UpdateDutState(ctx context.Context, ds *chromeosLab.DutState) (*chromeosLab.DutState, error)
- func UpdateKVM(ctx context.Context, kvm *ufspb.KVM, mask *field_mask.FieldMask) (*ufspb.KVM, error)
- func UpdateKVMHost(ctx context.Context, kvm *ufspb.KVM, nwOpt *ufsAPI.NetworkOption) error
- func UpdateLabMeta(ctx context.Context, meta *ufspb.LabMeta) error
- func UpdateLabstation(ctx context.Context, machinelse *ufspb.MachineLSE, mask *field_mask.FieldMask) (*ufspb.MachineLSE, error)
- func UpdateMachine(ctx context.Context, machine *ufspb.Machine, mask *field_mask.FieldMask) (*ufspb.Machine, error)
- func UpdateMachineLSE(ctx context.Context, machinelse *ufspb.MachineLSE, mask *field_mask.FieldMask) (*ufspb.MachineLSE, error)
- func UpdateMachineLSEDeployment(ctx context.Context, dr *ufspb.MachineLSEDeployment, ...) (*ufspb.MachineLSEDeployment, error)
- func UpdateMachineLSEHost(ctx context.Context, machinelseName string, nwOpt *ufsAPI.NetworkOption) (*ufspb.MachineLSE, error)
- func UpdateMachineLSEPrototype(ctx context.Context, machinelseprototype *ufspb.MachineLSEPrototype) (*ufspb.MachineLSEPrototype, error)
- func UpdateNic(ctx context.Context, nic *ufspb.Nic, mask *field_mask.FieldMask) (*ufspb.Nic, error)
- func UpdateRPM(ctx context.Context, rpm *ufspb.RPM, mask *field_mask.FieldMask) (*ufspb.RPM, error)
- func UpdateRPMHost(ctx context.Context, rpm *ufspb.RPM, nwOpt *ufsAPI.NetworkOption) error
- func UpdateRack(ctx context.Context, rack *ufspb.Rack, mask *field_mask.FieldMask) (*ufspb.Rack, error)
- func UpdateRackLSE(ctx context.Context, racklse *ufspb.RackLSE) (*ufspb.RackLSE, error)
- func UpdateRackLSEPrototype(ctx context.Context, racklseprototype *ufspb.RackLSEPrototype) (*ufspb.RackLSEPrototype, error)
- func UpdateSchedulingUnit(ctx context.Context, su *ufspb.SchedulingUnit, mask *field_mask.FieldMask) (*ufspb.SchedulingUnit, error)
- func UpdateState(ctx context.Context, stateRecord *ufspb.StateRecord) (*ufspb.StateRecord, error)
- func UpdateSwitch(ctx context.Context, s *ufspb.Switch, mask *field_mask.FieldMask) (*ufspb.Switch, error)
- func UpdateVM(ctx context.Context, vm *ufspb.VM, mask *field_mask.FieldMask) (*ufspb.VM, error)
- func UpdateVMHost(ctx context.Context, vmName string, nwOpt *ufsAPI.NetworkOption) (*ufspb.VM, error)
- func UpdateVlan(ctx context.Context, vlan *ufspb.Vlan, mask *field_mask.FieldMask) (*ufspb.Vlan, error)
- type HWIDClient
- type HistoryClient
- func (hc *HistoryClient) LogAddMachineChanges(machine *ufspb.Machine, nics []*ufspb.Nic, drac *ufspb.Drac)
- func (hc *HistoryClient) LogAddRackChanges(rack *ufspb.Rack, switches []*ufspb.Switch, kvms []*ufspb.KVM, ...)
- func (hc *HistoryClient) LogAssetChanges(oldData, newData *ufspb.Asset)
- func (hc *HistoryClient) LogAssetInfoChanges(resName string, oldInfo, newInfo *ufspb.AssetInfo)
- func (hc *HistoryClient) LogDracChanges(oldData, newData *ufspb.Drac)
- func (hc *HistoryClient) LogDutStateChanges(oldData, newData *chromeosLab.DutState)
- func (hc *HistoryClient) LogKVMChanges(oldData, newData *ufspb.KVM)
- func (hc *HistoryClient) LogMachineChanges(oldData *ufspb.Machine, newData *ufspb.Machine)
- func (hc *HistoryClient) LogMachineLSEChanges(oldData *ufspb.MachineLSE, newData *ufspb.MachineLSE)
- func (hc *HistoryClient) LogMachineLSEDeploymentChanges(oldData, newData *ufspb.MachineLSEDeployment)
- func (hc *HistoryClient) LogMachineLocationChanges(lses []*ufspb.MachineLSE, nics []*ufspb.Nic, dracs []*ufspb.Drac, ...)
- func (hc *HistoryClient) LogNicChanges(oldData, newData *ufspb.Nic)
- func (hc *HistoryClient) LogRPMChanges(oldData, newData *ufspb.RPM)
- func (hc *HistoryClient) LogRackChanges(oldData *ufspb.Rack, newData *ufspb.Rack)
- func (hc *HistoryClient) LogRackLocationChanges(kvms []*ufspb.KVM, switches []*ufspb.Switch, rpms []*ufspb.RPM, ...)
- func (hc *HistoryClient) LogSwitchChanges(oldData, newData *ufspb.Switch)
- func (hc *HistoryClient) LogVLANChanges(oldData, newData *ufspb.Vlan)
- func (hc *HistoryClient) LogVMChanges(oldData *ufspb.VM, newData *ufspb.VM)
- func (hc *HistoryClient) SaveChangeEvents(ctx context.Context) error
- type Resource
- func GetAssetResource(assetID string) *Resource
- func GetCachingServiceResource(cachingServiceID string) *Resource
- func GetChromePlatformResource(chromePlatformID string) *Resource
- func GetDracResource(dracID string) *Resource
- func GetKVMResource(kvmID string) *Resource
- func GetMachineLSEProtoTypeResource(machineLSEProtoTypeID string) *Resource
- func GetMachineLSEResource(machinelseID string) *Resource
- func GetMachineResource(machineID string) *Resource
- func GetNicResource(nicID string) *Resource
- func GetRPMResource(rpmID string) *Resource
- func GetRackLSEProtoTypeResource(rackLSEProtoTypeID string) *Resource
- func GetRackResource(rackID string) *Resource
- func GetSchedulingUnitResource(schedulingUnitID string) *Resource
- func GetSwitchResource(switchID string) *Resource
- func GetVMResource(vmID string) *Resource
- func GetVlanResource(vlanID string) *Resource
Constants ¶
const ( // LifeCycleRegistration indicates the registration of a resource. LifeCycleRegistration = "REGISTRATION" // LifeCycleDeployment indicates the deployment of a device. LifeCycleDeployment = "DEPLOYMENT" // LifeCycleDecomm indicates the decommission of a device. LifeCycleDecomm = "DECOMMISSION" // LifeCycleRetire indicates the retirement of a device. LifeCycleRetire = "RETIREMENT" // LifeCycleRename indicates the renaming of a device. LifeCycleRename = "RENAME" )
const (
CannotCreate string = "Cannot create"
)
error msgs used for testing
Variables ¶
var ( NotFoundErrorMessage string = "There is no %s with %sID %s in the system.\n" AlreadyExistsErrorMessage string = "%s %s already exists in the system.\n" )
Generalized error messages for resources in the system
Functions ¶
func AssetRegistration ¶
AssetRegistration registers the given asset to the datastore after validation
func BatchGetChromePlatforms ¶
BatchGetChromePlatforms returns a batch of chrome platforms from datastore.
func BatchGetDhcpConfigs ¶
BatchGetDhcpConfigs returns a batch of dhcp records
func BatchGetDracs ¶
BatchGetDracs returns a batch of dracs from datastore.
func BatchGetKVMs ¶
BatchGetKVMs returns a batch of kvms based on ids.
func BatchGetMachineLSEDeployments ¶
func BatchGetMachineLSEDeployments(ctx context.Context, ids []string) ([]*ufspb.MachineLSEDeployment, error)
BatchGetMachineLSEDeployments returns a batch of deployment records.
func BatchGetMachineLSEPrototypes ¶
func BatchGetMachineLSEPrototypes(ctx context.Context, ids []string) ([]*ufspb.MachineLSEPrototype, error)
BatchGetMachineLSEPrototypes returns a batch of machine lse prototypes from datastore.
func BatchGetMachineLSEs ¶
BatchGetMachineLSEs returns a batch of machine lses
func BatchGetMachines ¶
BatchGetMachines returns a batch of machines from datastore.
func BatchGetNics ¶
BatchGetNics returns a batch of nics from datastore.
func BatchGetRPMs ¶
BatchGetRPMs returns a batch of rpms from datastore.
func BatchGetRackLSEPrototypes ¶
func BatchGetRackLSEPrototypes(ctx context.Context, ids []string) ([]*ufspb.RackLSEPrototype, error)
BatchGetRackLSEPrototypes returns a batch of rack lse prototypes from datastore.
func BatchGetRacks ¶
BatchGetRacks returns a batch of racks from datastore.
func BatchGetSwitches ¶
BatchGetSwitches returns a batch of switches from datastore.
func BatchGetVMs ¶
BatchGetVMs returns a batch of vms from datastore.
func BatchGetVlans ¶
BatchGetVlans returns a batch of vlans from datastore.
func CreateCachingService ¶
func CreateCachingService(ctx context.Context, cs *ufspb.CachingService) (*ufspb.CachingService, error)
CreateCachingService creates a new CachingService in datastore.
func CreateChromePlatform ¶
func CreateChromePlatform(ctx context.Context, chromeplatform *ufspb.ChromePlatform) (*ufspb.ChromePlatform, error)
CreateChromePlatform creates a new chromeplatform in datastore.
func CreateDUT ¶
func CreateDUT(ctx context.Context, machinelse *ufspb.MachineLSE) (*ufspb.MachineLSE, error)
CreateDUT creates ChromeOSMachineLSE entities for a DUT.
Creates one MachineLSE for DUT and updates another MachineLSE for the Labstation(with new Servo info from DUT)
func CreateDrac ¶
CreateDrac creates a new drac in datastore.
Checks if the resources referenced by the Drac input already exists in the system before creating a new Drac
func CreateLabstation ¶
func CreateLabstation(ctx context.Context, lse *ufspb.MachineLSE) (*ufspb.MachineLSE, error)
CreateLabstation creates a new labstation entry in UFS.
func CreateMachineFromAsset ¶
CreateMachineFromAsset creates machine from asset
If the asset is either a DUT or Labstation, machine is returned, nil otherwise.
func CreateMachineLSE ¶
func CreateMachineLSE(ctx context.Context, machinelse *ufspb.MachineLSE, nwOpt *ufsAPI.NetworkOption) (*ufspb.MachineLSE, error)
CreateMachineLSE creates a new machinelse in datastore.
func CreateMachineLSEPrototype ¶
func CreateMachineLSEPrototype(ctx context.Context, machinelseprototype *ufspb.MachineLSEPrototype) (*ufspb.MachineLSEPrototype, error)
CreateMachineLSEPrototype creates a new machinelseprototype in datastore.
func CreateNic ¶
CreateNic creates a new nic in datastore.
Checks if the resources referenced by the Nic input already exists in the system before creating a new Nic
func CreateRackLSE ¶
CreateRackLSE creates a new racklse in datastore.
Checks if the resources referenced by the RackLSE input already exists in the system before creating a new RackLSE
func CreateRackLSEPrototype ¶
func CreateRackLSEPrototype(ctx context.Context, racklseprototype *ufspb.RackLSEPrototype) (*ufspb.RackLSEPrototype, error)
CreateRackLSEPrototype creates a new racklseprototype in datastore.
func CreateSchedulingUnit ¶
func CreateSchedulingUnit(ctx context.Context, su *ufspb.SchedulingUnit) (*ufspb.SchedulingUnit, error)
CreateSchedulingUnit creates a new SchedulingUnit in datastore.
func CreateSwitch ¶
CreateSwitch creates switch in datastore.
func CreateVlan ¶
CreateVlan creates a new vlan in datastore.
func DeleteAsset ¶
DeleteAsset deletes an asset from UFS
func DeleteCachingService ¶
DeleteCachingService deletes the given CachingService in datastore.
func DeleteChromePlatform ¶
DeleteChromePlatform deletes the chromeplatform in datastore
For referential data intergrity, Delete if this ChromePlatform is not referenced by other resources in the datastore. If there are any references, delete will be rejected and an error will be returned.
func DeleteDrac ¶
DeleteDrac deletes the drac in datastore
func DeleteDracHost ¶
DeleteDracHost deletes the host of a drac in datastore.
func DeleteKVMHost ¶
DeleteKVMHost deletes the host of a kvm in datastore.
func DeleteMachine ¶
DeleteMachine deletes the machine and its associated nics and drac in datastore
For referential data intergrity, Delete if this Machine is not referenced by other resources in the datastore. If there are any references, delete will be rejected and an error will be returned.
func DeleteMachineLSE ¶
DeleteMachineLSE deletes the machinelse in datastore
For referential data intergrity, Delete if this MachineLSE is not referenced by other resources in the datastore. If there are any references, delete will be rejected and an error will be returned.
func DeleteMachineLSEHost ¶
DeleteMachineLSEHost deletes the dhcp/ip of a machinelse in datastore.
func DeleteMachineLSEPrototype ¶
DeleteMachineLSEPrototype deletes the machinelseprototype in datastore
For referential data intergrity, Delete if this MachineLSEPrototype is not referenced by other resources in the datastore. If there are any references, delete will be rejected and an error will be returned.
func DeleteRPM ¶
DeleteRPM deletes the rpm in datastore
For referential data intergrity, Delete if this RPM is not referenced by other resources in the datastore. If there are any references, delete will be rejected and an error will be returned.
func DeleteRPMHost ¶
DeleteRPMHost deletes the host of a rpm in datastore.
func DeleteRack ¶
DeleteRack deletes the rack in datastore
For referential data intergrity, Delete if this Rack is not referenced by other resources in the datastore. If there are any references, delete will be rejected and an error will be returned.
func DeleteRackLSE ¶
DeleteRackLSE deletes the racklse in datastore
For referential data intergrity, Delete if this RackLSE is not referenced by other resources in the datastore. If there are any references, delete will be rejected and an error will be returned.
func DeleteRackLSEPrototype ¶
DeleteRackLSEPrototype deletes the racklseprototype in datastore
For referential data intergrity, Delete if this RackLSEPrototype is not referenced by other resources in the datastore. If there are any references, delete will be rejected and an error will be returned.
func DeleteSchedulingUnit ¶
DeleteSchedulingUnit deletes the given SchedulingUnit in datastore.
func DeleteSwitch ¶
DeleteSwitch deletes the switch in datastore
For referential data intergrity, 1. Validate if this switch is not referenced by other resources in the datastore. 2. Delete the switch 3. Get the rack associated with this switch 4. Update the rack by removing the association with this switch
func DeleteVMHost ¶
DeleteVMHost deletes the dhcp/ip of a vm in datastore.
func DeleteVlan ¶
DeleteVlan deletes the vlan in datastore
For referential data intergrity, Delete if this Vlan is not referenced by other resources in the datastore. If there are any references, delete will be rejected and an error will be returned.
func GetAllMachines ¶
GetAllMachines returns all machines in datastore.
func GetCachingService ¶
GetCachingService returns CachingService for the given id from datastore.
func GetChromeOSDeviceData ¶
func GetChromeOSDeviceData(ctx context.Context, id, hostname string) (*ufspb.ChromeOSDeviceData, error)
GetChromeOSDeviceData returns ChromeOSDeviceData for the given id/hostname from InvV2 and UFS.
func GetChromePlatform ¶
GetChromePlatform returns chromeplatform for the given id from datastore.
func GetDHCPConfig ¶
GetDHCPConfig returns a dhcp reecord based on hostname from datastore.
func GetDUTConnectedToServo ¶
func GetDUTConnectedToServo(ctx context.Context, servo *chromeosLab.Servo) (*ufspb.MachineLSE, error)
GetDUTConnectedToServo returns machineLSE of DUT connected to the servo
func GetDutState ¶
GetDutState returns the DutState for the ChromeOS device.
func GetMachine ¶
GetMachine returns machine for the given id from datastore.
func GetMachineLSE ¶
GetMachineLSE returns machinelse for the given id from datastore.
func GetMachineLSEDeployment ¶
GetMachineLSEDeployment returns the deployment record for the given id.
func GetMachineLSEPrototype ¶
GetMachineLSEPrototype returns machinelseprototype for the given id from datastore.
func GetRackLSE ¶
GetRackLSE returns racklse for the given id from datastore.
func GetRackLSEPrototype ¶
GetRackLSEPrototype returns racklseprototype for the given id from datastore.
func GetSchedulingUnit ¶
GetSchedulingUnit returns SchedulingUnit for the given id from datastore.
func ImportChromePlatforms ¶
func ImportChromePlatforms(ctx context.Context, platforms []*ufspb.ChromePlatform, pageSize int) (*ufsds.OpResults, error)
ImportChromePlatforms inserts chrome platforms to datastore.
func ImportDatacenter ¶
func ImportDatacenter(ctx context.Context, dcs []*crimsonconfig.Datacenter, pageSize int) (*datastore.OpResults, error)
ImportDatacenter imports the datacenters and the related resources.
The function will return:
- all of the results of the operations that already run
- the first error that it meets
The function will stop at the very first error.
func ImportDracs ¶
ImportDracs creates or updates a batch of dracs in datastore
func ImportMachineLSEs ¶
func ImportMachineLSEs(ctx context.Context, hosts []*crimson.PhysicalHost, vms []*crimson.VM, machines []*crimson.Machine, platforms []*crimson.Platform, pageSize int) (*ufsds.OpResults, error)
ImportMachineLSEs implements the logic of importing machine lses and related info to backend storage.
The function will return:
- all of the results of the operations that already run
- the first error that it meets
The function will stop at the very first error.
func ImportMachines ¶
func ImportMachines(ctx context.Context, machines []*ufspb.Machine, pageSize int) (*ufsds.OpResults, error)
ImportMachines creates or updates a batch of machines in datastore
func ImportNetworkInterfaces ¶
func ImportNetworkInterfaces(ctx context.Context, nics []*crimson.NIC, dracs []*crimson.DRAC, machines []*crimson.Machine, pageSize int) (*ufsds.OpResults, error)
ImportNetworkInterfaces creates or updates a batch of nics, dracs, and dhcps in datastore
func ImportOSMachineLSEs ¶
func ImportOSMachineLSEs(ctx context.Context, labConfigs []*invV2Api.ListCrosDevicesLabConfigResponse_LabConfig, pageSize int) (*ufsds.OpResults, error)
ImportOSMachineLSEs implements the logic of importing ChromeOS machine lses and related info to backend storage.
The function will return:
- all of the results of the operations that already run
- the first error that it meets
The function will stop at the very first error.
func ImportOSVlans ¶
func ImportOSVlans(ctx context.Context, sheetClient sheet.ClientInterface, gitClient git.ClientInterface, pageSize int) (*ufsds.OpResults, error)
ImportOSVlans imports the logic of parse and save network infos.
func ImportOSes ¶
func ImportOSes(ctx context.Context, oses []*ufspb.OSVersion, pageSize int) (*ufsds.OpResults, error)
ImportOSes inserts chrome os_version to datastore.
func ImportStates ¶
func ImportStates(ctx context.Context, machines []*crimson.Machine, racks []*crimson.Rack, hosts []*crimson.PhysicalHost, vms []*crimson.VM, vlans []*crimson.VLAN, kvms []*crimson.KVM, switches []*crimson.Switch, pageSize int) (*ufsds.OpResults, error)
ImportStates imports states of UFS resources.
func ImportVlans ¶
func ImportVlans(ctx context.Context, vlans []*crimsonconfig.VLAN, pageSize int) (*ufsds.OpResults, error)
ImportVlans implements the logic of importing vlans and related info to backend storage.
The function will return:
- all of the results of the operations that already run
- the first error that it meets
The function will stop at the very first error.
func ListAssets ¶
func ListAssets(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.Asset, string, error)
ListAssets lists the assets
func ListCachingServices ¶
func ListCachingServices(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.CachingService, string, error)
ListCachingServices lists the CachingServices in datastore.
func ListChromePlatforms ¶
func ListChromePlatforms(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.ChromePlatform, string, error)
ListChromePlatforms lists the chromeplatforms
func ListDracs ¶
func ListDracs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.Drac, string, error)
ListDracs lists the dracs
func ListDutStates ¶
func ListDutStates(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*chromeosLab.DutState, string, error)
ListDutStates lists the DutStates in datastore.
func ListKVMs ¶
func ListKVMs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.KVM, string, error)
ListKVMs lists the kvms
func ListMachineLSEDeployments ¶
func ListMachineLSEDeployments(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.MachineLSEDeployment, string, error)
ListMachineLSEDeployments returns a batch of deployment records by filters
func ListMachineLSEPrototypes ¶
func ListMachineLSEPrototypes(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.MachineLSEPrototype, string, error)
ListMachineLSEPrototypes lists the machinelseprototypes
func ListMachineLSEs ¶
func ListMachineLSEs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly, full bool) ([]*ufspb.MachineLSE, string, error)
ListMachineLSEs lists the machinelses
func ListMachines ¶
func ListMachines(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly, full bool) ([]*ufspb.Machine, string, error)
ListMachines lists the machines
func ListNics ¶
func ListNics(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.Nic, string, error)
ListNics lists the nics
func ListOSes ¶
func ListOSes(ctx context.Context, pageSize int32, pageToken string, filter string, keysOnly bool) ([]*ufspb.OSVersion, string, error)
ListOSes lists the chrome os_version
func ListRPMs ¶
func ListRPMs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.RPM, string, error)
ListRPMs lists the rpms
func ListRackLSEPrototypes ¶
func ListRackLSEPrototypes(ctx context.Context, pageSize int32, pageToken string, filter string, keysOnly bool) ([]*ufspb.RackLSEPrototype, string, error)
ListRackLSEPrototypes lists the racklseprototypes
func ListRackLSEs ¶
func ListRackLSEs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.RackLSE, string, error)
ListRackLSEs lists the racklses
func ListRacks ¶
func ListRacks(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly, full bool) ([]*ufspb.Rack, string, error)
ListRacks lists the racks
func ListSchedulingUnits ¶
func ListSchedulingUnits(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.SchedulingUnit, string, error)
ListSchedulingUnits lists the SchedulingUnits in datastore.
func ListSwitches ¶
func ListSwitches(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.Switch, string, error)
ListSwitches lists the switches
func ListVMs ¶
func ListVMs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.VM, string, error)
ListVMs lists the vms
func ListVlans ¶
func ListVlans(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.Vlan, string, error)
ListVlans lists the vlans
func LogDHCPChanges ¶
func LogDHCPChanges(oldData, newData *ufspb.DHCPConfig) ([]*ufspb.ChangeEvent, *history.SnapshotMsgEntity)
LogDHCPChanges logs the change of the given dhcp.
func LogIPChanges ¶
func LogIPChanges(oldData, newData *ufspb.IP) []*ufspb.ChangeEvent
LogIPChanges logs the change of the given ip.
func LogStateChanges ¶
func LogStateChanges(oldData, newData *ufspb.StateRecord) ([]*ufspb.ChangeEvent, *history.SnapshotMsgEntity)
LogStateChanges logs the change of the given state record.
func MachineRegistration ¶
MachineRegistration creates a new machine, new nic and a new drac in datastore.
func RackRegistration ¶
RackRegistration creates a new rack, switches, kvms and rpms in datastore.
func RenameAsset ¶
RenameAsset renames a given asset (and corresponding machine if available) with new name.
func RenameMachine ¶
func RenameMachine(ctx context.Context, oldMachineName, newMachineName string) (machine *ufspb.Machine, err error)
RenameMachine renames the machine and updates the associated nics, drac and machinelse in datastore
func RenameMachineLSE ¶
RenameMachineLSE renames the machineLSE to the new hostname.
func RenameSwitch ¶
RenameSwitch renames the switch and updates the associated machinelse in datastore
func ReplaceChromePlatform ¶
func ReplaceChromePlatform(ctx context.Context, oldChromePlatform *ufspb.ChromePlatform, newChromePlatform *ufspb.ChromePlatform) (*ufspb.ChromePlatform, error)
ReplaceChromePlatform replaces an old ChromePlatform with new ChromePlatform in datastore
It does a delete of old chromeplatform and create of new ChromePlatform. All the steps are in done in a transaction to preserve consistency on failure. Before deleting the old ChromePlatform, it will get all the resources referencing the old ChromePlatform. It will update all the resources which were referencing the old ChromePlatform(got in the last step) with new ChromePlatform. Deletes the old ChromePlatform. Creates the new ChromePlatform. This will preserve data integrity in the system.
func ReplaceDrac ¶
func ReplaceDrac(ctx context.Context, oldDrac *ufspb.Drac, newDrac *ufspb.Drac) (*ufspb.Drac, error)
ReplaceDrac replaces an old Drac with new Drac in datastore
It does a delete of old drac and create of new Drac. All the steps are in done in a transaction to preserve consistency on failure. Before deleting the old Drac, it will get all the resources referencing the old Drac. It will update all the resources which were referencing the old Drac(got in the last step) with new Drac. Deletes the old Drac. Creates the new Drac. This will preserve data integrity in the system.
func ReplaceKVM ¶
ReplaceKVM replaces an old KVM with new KVM in datastore
It does a delete of old kvm and create of new KVM. All the steps are in done in a transaction to preserve consistency on failure. Before deleting the old KVM, it will get all the resources referencing the old KVM. It will update all the resources which were referencing the old KVM(got in the last step) with new KVM. Deletes the old KVM. Creates the new KVM. This will preserve data integrity in the system.
func ReplaceMachine ¶
func ReplaceMachine(ctx context.Context, oldMachine *ufspb.Machine, newMachine *ufspb.Machine) (*ufspb.Machine, error)
ReplaceMachine replaces an old Machine with new Machine in datastore
It does a delete of old machine and create of new Machine. All the steps are in done in a transaction to preserve consistency on failure. Before deleting the old Machine, it will get all the resources referencing the old Machine. It will update all the resources which were referencing the old Machine(got in the last step) with new Machine. Deletes the old Machine. Creates the new Machine. This will preserve data integrity in the system.
func ReplaceMachineLSEPrototype ¶
func ReplaceMachineLSEPrototype(ctx context.Context, oldMachineLSEPrototype *ufspb.MachineLSEPrototype, newMachineLSEPrototype *ufspb.MachineLSEPrototype) (*ufspb.MachineLSEPrototype, error)
ReplaceMachineLSEPrototype replaces an old MachineLSEPrototype with new MachineLSEPrototype in datastore
It does a delete of old machinelseprototype and create of new MachineLSEPrototype. All the steps are in done in a transaction to preserve consistency on failure. Before deleting the old MachineLSEPrototype, it will get all the resources referencing the old MachineLSEPrototype. It will update all the resources which were referencing the old MachineLSEPrototype(got in the last step) with new MachineLSEPrototype. Deletes the old MachineLSEPrototype. Creates the new MachineLSEPrototype. This will preserve data integrity in the system.
func ReplaceNic ¶
ReplaceNic replaces an old Nic with new Nic in datastore
It does a delete of old nic and create of new Nic. All the steps are in done in a transaction to preserve consistency on failure. Before deleting the old Nic, it will get all the resources referencing the old Nic. It will update all the resources which were referencing the old Nic(got in the last step) with new Nic. Deletes the old Nic. Creates the new Nic. This will preserve data integrity in the system.
func ReplaceRPM ¶
ReplaceRPM replaces an old RPM with new RPM in datastore
It does a delete of old rpm and create of new RPM. All the steps are in done in a transaction to preserve consistency on failure. Before deleting the old RPM, it will get all the resources referencing the old RPM. It will update all the resources which were referencing the old RPM(got in the last step) with new RPM. Deletes the old RPM. Creates the new RPM. This will preserve data integrity in the system.
func ReplaceRack ¶
func ReplaceRack(ctx context.Context, oldRack *ufspb.Rack, newRack *ufspb.Rack) (*ufspb.Rack, error)
ReplaceRack replaces an old Rack with new Rack in datastore
It does a delete of old rack and create of new Rack. All the steps are in done in a transaction to preserve consistency on failure. Before deleting the old Rack, it will get all the resources referencing the old Rack. It will update all the resources which were referencing the old Rack(got in the last step) with new Rack. Deletes the old Rack. Creates the new Rack. This will preserve data integrity in the system.
func ReplaceRackLSEPrototype ¶
func ReplaceRackLSEPrototype(ctx context.Context, oldRackLSEPrototype *ufspb.RackLSEPrototype, newRackLSEPrototype *ufspb.RackLSEPrototype) (*ufspb.RackLSEPrototype, error)
ReplaceRackLSEPrototype replaces an old RackLSEPrototype with new RackLSEPrototype in datastore
It does a delete of old racklseprototype and create of new RackLSEPrototype. All the steps are in done in a transaction to preserve consistency on failure. Before deleting the old RackLSEPrototype, it will get all the resources referencing the old RackLSEPrototype. It will update all the resources which were referencing the old RackLSEPrototype(got in the last step) with new RackLSEPrototype. Deletes the old RackLSEPrototype. Creates the new RackLSEPrototype. This will preserve data integrity in the system.
func ReplaceSwitch ¶
func ReplaceSwitch(ctx context.Context, oldSwitch *ufspb.Switch, newSwitch *ufspb.Switch) (*ufspb.Switch, error)
ReplaceSwitch replaces an old Switch with new Switch in datastore
It does a delete of old switch and create of new Switch. All the steps are in done in a transaction to preserve consistency on failure. Before deleting the old Switch, it will get all the resources referencing the old Switch. It will update all the resources which were referencing the old Switch(got in the last step) with new Switch. Deletes the old Switch. Creates the new Switch. This will preserve data integrity in the system.
func ReplaceVlan ¶
func ReplaceVlan(ctx context.Context, oldVlan *ufspb.Vlan, newVlan *ufspb.Vlan) (*ufspb.Vlan, error)
ReplaceVlan replaces an old Vlan with new Vlan in datastore
It does a delete of old vlan and create of new Vlan. All the steps are in done in a transaction to preserve consistency on failure. Before deleting the old Vlan, it will get all the resources referencing the old Vlan. It will update all the resources which were referencing the old Vlan(got in the last step) with new Vlan. Deletes the old Vlan. Creates the new Vlan. This will preserve data integrity in the system.
func ResourceExist ¶
ResourceExist checks if the given resources exists in the datastore
Returns error if any one resource does not exist in the system. Appends error messages to the the given error message for resources that does not exist in the datastore.
func UpdateAsset ¶
func UpdateAsset(ctx context.Context, asset *ufspb.Asset, mask *field_mask.FieldMask) (*ufspb.Asset, error)
UpdateAsset updates the asset record to the datastore after validation
func UpdateAssetMeta ¶
UpdateAssetMeta updates only dut meta data portion of the Asset.
It's a temporary method to correct Serial number, HWID and Sku. Will remove once HaRT could provide us the correct info.
func UpdateCachingService ¶
func UpdateCachingService(ctx context.Context, cs *ufspb.CachingService, mask *field_mask.FieldMask) (*ufspb.CachingService, error)
UpdateCachingService updates existing CachingService in datastore.
func UpdateChromePlatform ¶
func UpdateChromePlatform(ctx context.Context, chromeplatform *ufspb.ChromePlatform, mask *field_mask.FieldMask) (*ufspb.ChromePlatform, error)
UpdateChromePlatform updates chromeplatform in datastore.
func UpdateConfigBundle ¶
func UpdateConfigBundle(ctx context.Context, cb []byte, mask *field_mask.FieldMask, allowMissing bool) ([]byte, error)
UpdateConfigBundle updates ConfigBundle in datastore.
func UpdateDUT ¶
func UpdateDUT(ctx context.Context, machinelse *ufspb.MachineLSE, mask *field_mask.FieldMask) (*ufspb.MachineLSE, error)
UpdateDUT updates a chrome OS DUT.
updates one MachineLSE for DUT and updates Labstation MachineLSE (with new Servo info from DUT). If DUT is connected to the same Labstation but different port, The servo entry in Labstation is updated. If DUT is connected to a different labstation, then old servo info of DUT is removed from old Labstation and new servo info from the DUT is added to the new labstation.
func UpdateDrac ¶
func UpdateDrac(ctx context.Context, drac *ufspb.Drac, mask *field_mask.FieldMask) (*ufspb.Drac, error)
UpdateDrac updates drac in datastore.
Checks if the resources referenced by the Drac input already exists in the system before updating a Drac
func UpdateDracHost ¶
UpdateDracHost updates the drac host in datastore.
func UpdateDutMeta ¶
UpdateDutMeta updates only duta meta data for a given ChromeOS DUT.
It's a temporary method to correct serial number & HWID. Will remove once HaRT could provide us the correct info.
func UpdateDutState ¶
func UpdateDutState(ctx context.Context, ds *chromeosLab.DutState) (*chromeosLab.DutState, error)
UpdateDutState updates the dut state for a ChromeOS DUT
func UpdateKVMHost ¶
UpdateKVMHost updates the kvm host in datastore.
func UpdateLabMeta ¶
UpdateLabMeta updates only lab meta data for a given ChromeOS DUT.
func UpdateLabstation ¶
func UpdateLabstation(ctx context.Context, machinelse *ufspb.MachineLSE, mask *field_mask.FieldMask) (*ufspb.MachineLSE, error)
UpdateLabstation validates and updates the given labstation machine LSE.
func UpdateMachine ¶
func UpdateMachine(ctx context.Context, machine *ufspb.Machine, mask *field_mask.FieldMask) (*ufspb.Machine, error)
UpdateMachine updates machine in datastore.
Checks if the resources referenced by the Machine input already exists in the system before updating a Machine
func UpdateMachineLSE ¶
func UpdateMachineLSE(ctx context.Context, machinelse *ufspb.MachineLSE, mask *field_mask.FieldMask) (*ufspb.MachineLSE, error)
UpdateMachineLSE updates machinelse in datastore.
func UpdateMachineLSEDeployment ¶
func UpdateMachineLSEDeployment(ctx context.Context, dr *ufspb.MachineLSEDeployment, mask *field_mask.FieldMask) (*ufspb.MachineLSEDeployment, error)
UpdateMachineLSEDeployment updates a machine lse deployment to datastore
func UpdateMachineLSEHost ¶
func UpdateMachineLSEHost(ctx context.Context, machinelseName string, nwOpt *ufsAPI.NetworkOption) (*ufspb.MachineLSE, error)
UpdateMachineLSEHost updates the machinelse host(update ip assignment).
func UpdateMachineLSEPrototype ¶
func UpdateMachineLSEPrototype(ctx context.Context, machinelseprototype *ufspb.MachineLSEPrototype) (*ufspb.MachineLSEPrototype, error)
UpdateMachineLSEPrototype updates machinelseprototype in datastore.
func UpdateNic ¶
UpdateNic updates nic in datastore.
Checks if the resources referenced by the Nic input already exists in the system before updating a Nic
func UpdateRPMHost ¶
UpdateRPMHost updates the rpm host in datastore.
func UpdateRack ¶
func UpdateRack(ctx context.Context, rack *ufspb.Rack, mask *field_mask.FieldMask) (*ufspb.Rack, error)
UpdateRack updates rack in datastore.
func UpdateRackLSE ¶
UpdateRackLSE updates racklse in datastore.
Checks if the resources referenced by the RackLSE input already exists in the system before updating a RackLSE
func UpdateRackLSEPrototype ¶
func UpdateRackLSEPrototype(ctx context.Context, racklseprototype *ufspb.RackLSEPrototype) (*ufspb.RackLSEPrototype, error)
UpdateRackLSEPrototype updates racklseprototype in datastore.
func UpdateSchedulingUnit ¶
func UpdateSchedulingUnit(ctx context.Context, su *ufspb.SchedulingUnit, mask *field_mask.FieldMask) (*ufspb.SchedulingUnit, error)
UpdateSchedulingUnit updates existing SchedulingUnit in datastore.
func UpdateState ¶
func UpdateState(ctx context.Context, stateRecord *ufspb.StateRecord) (*ufspb.StateRecord, error)
UpdateState updates state record for a resource.
func UpdateSwitch ¶
func UpdateSwitch(ctx context.Context, s *ufspb.Switch, mask *field_mask.FieldMask) (*ufspb.Switch, error)
UpdateSwitch updates switch in datastore.
func UpdateVMHost ¶
func UpdateVMHost(ctx context.Context, vmName string, nwOpt *ufsAPI.NetworkOption) (*ufspb.VM, error)
UpdateVMHost updates the vm host(update ip assignment).
Types ¶
type HWIDClient ¶
type HWIDClient struct {
// contains filtered or unexported fields
}
func InitHWIDClient ¶
func InitHWIDClient(ctx context.Context) (*HWIDClient, error)
type HistoryClient ¶
type HistoryClient struct {
// contains filtered or unexported fields
}
HistoryClient is a client for managing change histories
func GetMachineHistoryClient ¶
func GetMachineHistoryClient(m *ufspb.Machine) *HistoryClient
func (*HistoryClient) LogAddMachineChanges ¶
func (hc *HistoryClient) LogAddMachineChanges(machine *ufspb.Machine, nics []*ufspb.Nic, drac *ufspb.Drac)
LogAddMachineChanges logs the changes for adding machine
func (*HistoryClient) LogAddRackChanges ¶
func (hc *HistoryClient) LogAddRackChanges(rack *ufspb.Rack, switches []*ufspb.Switch, kvms []*ufspb.KVM, rpms []*ufspb.RPM)
LogAddRackChanges logs the changes for adding rack
func (*HistoryClient) LogAssetChanges ¶
func (hc *HistoryClient) LogAssetChanges(oldData, newData *ufspb.Asset)
LogAssetChanges logs the change of the given asset.
func (*HistoryClient) LogAssetInfoChanges ¶
func (hc *HistoryClient) LogAssetInfoChanges(resName string, oldInfo, newInfo *ufspb.AssetInfo)
LogAssetInfoChanges logs the change of a give asset info
func (*HistoryClient) LogDracChanges ¶
func (hc *HistoryClient) LogDracChanges(oldData, newData *ufspb.Drac)
LogDracChanges logs the change of the given drac.
func (*HistoryClient) LogDutStateChanges ¶
func (hc *HistoryClient) LogDutStateChanges(oldData, newData *chromeosLab.DutState)
LogDutStateChanges logs the change of a dut state record.
func (*HistoryClient) LogKVMChanges ¶
func (hc *HistoryClient) LogKVMChanges(oldData, newData *ufspb.KVM)
LogKVMChanges logs the change of the given kvm.
func (*HistoryClient) LogMachineChanges ¶
func (hc *HistoryClient) LogMachineChanges(oldData *ufspb.Machine, newData *ufspb.Machine)
LogMachineChanges logs the change of the given machine.
func (*HistoryClient) LogMachineLSEChanges ¶
func (hc *HistoryClient) LogMachineLSEChanges(oldData *ufspb.MachineLSE, newData *ufspb.MachineLSE)
LogMachineLSEChanges logs the change of the given machine lse.
func (*HistoryClient) LogMachineLSEDeploymentChanges ¶
func (hc *HistoryClient) LogMachineLSEDeploymentChanges(oldData, newData *ufspb.MachineLSEDeployment)
LogMachineLSEDeploymentChanges logs the change of a given machine lse deployment record.
func (*HistoryClient) LogMachineLocationChanges ¶
func (hc *HistoryClient) LogMachineLocationChanges(lses []*ufspb.MachineLSE, nics []*ufspb.Nic, dracs []*ufspb.Drac, vms []*ufspb.VM, indexMap, oldIndexMap map[string]string)
LogMachineLocationChanges logs the changes for changing locations of a machine
func (*HistoryClient) LogNicChanges ¶
func (hc *HistoryClient) LogNicChanges(oldData, newData *ufspb.Nic)
LogNicChanges logs the change of the given nic.
func (*HistoryClient) LogRPMChanges ¶
func (hc *HistoryClient) LogRPMChanges(oldData, newData *ufspb.RPM)
LogRPMChanges logs the change of the given rpms.
func (*HistoryClient) LogRackChanges ¶
func (hc *HistoryClient) LogRackChanges(oldData *ufspb.Rack, newData *ufspb.Rack)
LogRackChanges logs the change of the given rack.
func (*HistoryClient) LogRackLocationChanges ¶
func (hc *HistoryClient) LogRackLocationChanges(kvms []*ufspb.KVM, switches []*ufspb.Switch, rpms []*ufspb.RPM, indexMap, oldIndexMap map[string]string)
LogRackLocationChanges logs the changes for changing locations of a rack
func (*HistoryClient) LogSwitchChanges ¶
func (hc *HistoryClient) LogSwitchChanges(oldData, newData *ufspb.Switch)
LogSwitchChanges logs the change of the given switch.
func (*HistoryClient) LogVLANChanges ¶
func (hc *HistoryClient) LogVLANChanges(oldData, newData *ufspb.Vlan)
LogVLANChanges logs the change of the given vlan.
func (*HistoryClient) LogVMChanges ¶
func (hc *HistoryClient) LogVMChanges(oldData *ufspb.VM, newData *ufspb.VM)
LogVMChanges logs the change of the given vms.
func (*HistoryClient) SaveChangeEvents ¶
func (hc *HistoryClient) SaveChangeEvents(ctx context.Context) error
SaveChangeEvents saves change events to database
type Resource ¶
type Resource struct { Kind string ID string Entity ufsds.FleetEntity }
Resource contains the fleet entity to be checked and the ID and Kind
func GetAssetResource ¶
GetAssetResource returns a Resource with AssetEntity
func GetCachingServiceResource ¶
GetCachingServiceResource returns a Resource with CSEntity.
func GetChromePlatformResource ¶
GetChromePlatformResource returns a Resource with ChromePlatformEntity
func GetDracResource ¶
GetDracResource returns a Resource with DracEntity
func GetKVMResource ¶
GetKVMResource returns a Resource with KVMEntity
func GetMachineLSEProtoTypeResource ¶
GetMachineLSEProtoTypeResource returns a Resource with MachineLSEProtoTypeEntity
func GetMachineLSEResource ¶
GetMachineLSEResource returns a Resource with MachineLSEEntity
func GetMachineResource ¶
GetMachineResource returns a Resource with MachineEntity
func GetNicResource ¶
GetNicResource returns a Resource with NicEntity
func GetRPMResource ¶
GetRPMResource returns a Resource with RPMEntity
func GetRackLSEProtoTypeResource ¶
GetRackLSEProtoTypeResource returns a Resource with RackLSEProtoTypeEntity
func GetRackResource ¶
GetRackResource returns a Resource with RackEntity
func GetSchedulingUnitResource ¶
GetSchedulingUnitResource returns a Resource with SchedulingUnitEntity.
func GetSwitchResource ¶
GetSwitchResource returns a Resource with SwitchEntity
func GetVMResource ¶
GetVMResource returns a Resource with VMEntity
func GetVlanResource ¶
GetVlanResource returns a Resource with VlanEntity
Source Files ¶
- asset.go
- caching_service.go
- change.go
- change_helper.go
- chrome_platform.go
- config_bundle.go
- datacenter.go
- dhcp.go
- drac.go
- dut.go
- dut_state.go
- helper.go
- hwid.go
- kvm.go
- labstation.go
- machine.go
- machine_lse.go
- machine_lse_deployment.go
- machine_lse_prototype.go
- network.go
- network_updater.go
- nic.go
- os_version.go
- rack.go
- rack_lse.go
- rack_lse_prototype.go
- rpm.go
- scheduling_unit.go
- state.go
- state_updater.go
- switch.go
- testing.go
- vlan.go
- vm.go