Documentation
¶
Overview ¶
Package controller provides a high-level interface for managing devices.
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 BatchGetDeviceLabels(ctx context.Context, ids []string) ([]*ufspb.DeviceLabels, 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 Convert(ctx context.Context, dutAttr *api.DutAttribute, flatConfig *payload.FlatConfig, ...) (swarming.Dimensions, error)
- func ConvertHwidDataLabels(ctx context.Context, hwidData *ufspb.HwidData) (swarming.Dimensions, 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 CreateDefaultWifi(ctx context.Context, wifi *ufspb.DefaultWifi) (*ufspb.DefaultWifi, error)
- func CreateDeviceLabels(ctx context.Context, deviceLabels *ufspb.DeviceLabels, realm string) (*ufspb.DeviceLabels, 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 CreatePubSubTopicClient(ctx context.Context, topicID string) (*pubsub.Topic, 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 DeleteDefaultWifi(ctx context.Context, id string) error
- func DeleteDeviceLabels(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 GetAsset(ctx context.Context, name string) (*ufspb.Asset, error)
- func GetAttachedDeviceData(ctx context.Context, lse *ufspb.MachineLSE) (*ufsAPI.AttachedDeviceData, error)
- func GetBotConfigsForCommitSh(ctx context.Context, commitsh string) ([]*api.OwnershipByHost, error)
- func GetBrowserVMLabels(vm *ufspb.VM) *ufspb.DeviceLabels
- 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 GetConfigAndGitClient(ctx context.Context) (*config.OwnershipConfig, git.ClientInterface, error)
- func GetDHCPConfig(ctx context.Context, hostname string) (*ufspb.DHCPConfig, error)
- func GetDUTConnectedToServo(ctx context.Context, servo *chromeosLab.Servo) (*ufspb.MachineLSE, error)
- func GetDUTsConnectedToLabstation(ctx context.Context, labstation string) ([]*ufspb.MachineLSE, error)
- func GetDefaultWifi(ctx context.Context, name string) (*ufspb.DefaultWifi, error)
- func GetDeviceConfigClient(ctx context.Context) (external.DeviceConfigClient, error)
- func GetDeviceLabels(ctx context.Context, id string) (*ufspb.DeviceLabels, error)
- func GetDrac(ctx context.Context, id string) (*ufspb.Drac, error)
- func GetDutAttribute(ctx context.Context, id string) (*api.DutAttribute, error)
- func GetDutState(ctx context.Context, id, hostname string) (*chromeosLab.DutState, error)
- func GetHostData(ctx context.Context, serial string, full bool) (*ufspb.MachineLSE, *ufspb.Machine, error)
- func GetHwidClient(ctx context.Context) (hwid.ClientInterface, error)
- func GetHwidData(ctx context.Context, c hwid.ClientInterface, hwid string) (data *ufspb.HwidData, err 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 GetMachineLSEBySerial(ctx context.Context, serial string, full bool) (*ufspb.MachineLSE, error)
- func GetMachineLSEDeployment(ctx context.Context, id string) (*ufspb.MachineLSEDeployment, error)
- func GetMachineLSELabels(ctx context.Context, lse *ufspb.MachineLSE) (*ufspb.DeviceLabels, error)
- func GetMachineLSEPrototype(ctx context.Context, id string) (*ufspb.MachineLSEPrototype, error)
- func GetNic(ctx context.Context, id string) (*ufspb.Nic, error)
- func GetOwnershipData(ctx context.Context, hostName string) (*ufspb.OwnershipData, 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 GetSchedulingUnitLabels(ctx context.Context, su *ufspb.SchedulingUnit, lses []*ufspb.MachineLSE) (*ufspb.DeviceLabels, 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 ImportBotConfigs(ctx context.Context) error
- func ImportOSVlans(ctx context.Context, sheetClient sheet.ClientInterface, ...) (*ufsds.OpResults, error)
- func ImportPublicBoardsAndModels(ctx context.Context, goldenEyeDevices *ufspb.GoldenEyeDevices) error
- func ImportSecurityConfig(ctx context.Context, ownershipConfig *config.OwnershipConfig, ...) error
- func IsValidTest(ctx context.Context, req *api.CheckFleetTestsPolicyRequest) 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 ListDefaultWifis(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) (res []*ufspb.DefaultWifi, nextPageToken string, err error)
- func ListDeviceLabels(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.DeviceLabels, string, error)
- func ListDracs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.Drac, string, error)
- func ListDutAttributes(ctx context.Context, keysOnly bool) ([]*api.DutAttribute, error)
- func ListDutStates(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*chromeosLab.DutState, string, error)
- func ListHwidData(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.HwidData, string, error)
- func ListIPs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.IP, 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 ListOwnershipConfigs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*api.OwnershipByHost, 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 ParseSecurityConfig(ctx context.Context, config *ufspb.SecurityInfos)
- 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 RenameRack(ctx context.Context, oldName, newName string) (rack *ufspb.Rack, err 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 UpdateDefaultWifi(ctx context.Context, wifi *ufspb.DefaultWifi, mask *field_mask.FieldMask) (*ufspb.DefaultWifi, error)
- func UpdateDeviceLabels(ctx context.Context, deviceLabels *ufspb.DeviceLabels, ...) (*ufspb.DeviceLabels, 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 UpdateDutStateWithMasks(ctx context.Context, maskSet map[string]bool, 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 UpdateRecoveryData(ctx context.Context, req *ufsAPI.UpdateDeviceRecoveryDataRequest) 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 UpdateTestData(ctx context.Context, req *ufsAPI.UpdateTestDataRequest) 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 ConfigSha
- 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) LogDeviceLabelsChanges(oldData, newData *ufspb.DeviceLabels)
- 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 InvalidBoardError
- type InvalidImageError
- type InvalidModelError
- type InvalidQsAccountError
- type InvalidTestError
- type Resource
- func GetAssetResource(assetID string) *Resource
- func GetCachingServiceResource(cachingServiceID string) *Resource
- func GetChromePlatformResource(chromePlatformID string) *Resource
- func GetDefaultWifiResource(defaultWifiID string) *Resource
- func GetDeviceLabelsResource(deviceLabelsID 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 ( // LUCI Auth group which is used to verify if a service account has permissions to run public Chromium tests in ChromeOS lab PublicUsersToChromeOSAuthGroup = "public-chromium-in-chromeos-builders" // Date Format to parse launch date for Device info read from DLM DateFormat = "2006-01-02" )
const (
CannotCreate string = "Cannot create"
)
error msgs used for testing
const (
POOL_PREFIX = "pool:"
)
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
var OwnershipConfigsCounter = metric.NewInt( "ufs/fleet/ownership", "ownership data updated at sync", nil, field.String("host"), field.String("security_level"), field.String("swarming_instance"), field.String("customer"), field.Bool("prefix"), )
var ResourceTypeToPrefix = map[ufspb.ResourceType][]string{ ufspb.ResourceType_RESOURCE_TYPE_SCHEDULING_UNIT: {util.SchedulingUnitCollection}, ufspb.ResourceType_RESOURCE_TYPE_CHROMEOS_DEVICE: {util.MachineLSECollection}, ufspb.ResourceType_RESOURCE_TYPE_ATTACHED_DEVICE: {util.MachineLSECollection}, ufspb.ResourceType_RESOURCE_TYPE_BROWSER_DEVICE: {util.MachineLSECollection, util.VMCollection}, }
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 BatchGetDeviceLabels ¶
BatchGetDeviceLabels returns a batch of device labels 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 Convert ¶
func Convert(ctx context.Context, dutAttr *api.DutAttribute, flatConfig *payload.FlatConfig, lse *ufspb.MachineLSE, dutState *chromeosLab.DutState) (swarming.Dimensions, error)
Convert converts one DutAttribute label to multiple Swarming labels.
For all TleSource labels needed to be converted for UFS, the implementation is handled in this file. All other labels uses the Boxster Swarming lib for conversion.
func ConvertHwidDataLabels ¶
func ConvertHwidDataLabels(ctx context.Context, hwidData *ufspb.HwidData) (swarming.Dimensions, error)
ConvertHwidDataLabels converts HwidData hwid_components into test labels.
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 CreateDefaultWifi ¶
func CreateDefaultWifi(ctx context.Context, wifi *ufspb.DefaultWifi) (*ufspb.DefaultWifi, error)
CreateDefaultWifi creates a default wifi in the datastore.
func CreateDeviceLabels ¶
func CreateDeviceLabels(ctx context.Context, deviceLabels *ufspb.DeviceLabels, realm string) (*ufspb.DeviceLabels, error)
CreateDeviceLabels creates a new DeviceLabel in datastore.
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 CreatePubSubTopicClient ¶
CreatePubSubTopicClient returns back an instance of a Pub/Sub client for the given target.
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 DeleteDeviceLabels ¶
DeleteDeviceLabels deletes a device label in datastore.
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 GetAttachedDeviceData ¶
func GetAttachedDeviceData(ctx context.Context, lse *ufspb.MachineLSE) (*ufsAPI.AttachedDeviceData, error)
GetAttachedDeviceData returns AttachedDeviceData for the given id/hostname from UFS.
func GetBotConfigsForCommitSh ¶
GetBotConfigsForCommitSh gets the OwnershipConfigs at a particular commitsh
func GetBrowserVMLabels ¶
func GetBrowserVMLabels(vm *ufspb.VM) *ufspb.DeviceLabels
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 GetConfigAndGitClient ¶
func GetConfigAndGitClient(ctx context.Context) (*config.OwnershipConfig, git.ClientInterface, error)
GetConfigAndGitClient reads the OwnershipConfig and creates a corresponding git client
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 GetDUTsConnectedToLabstation ¶
func GetDUTsConnectedToLabstation(ctx context.Context, labstation string) ([]*ufspb.MachineLSE, error)
GetDUTsConnectedToLabstation returns a list of DUTs whose servo hostname is the given labstation
func GetDefaultWifi ¶
func GetDeviceConfigClient ¶
func GetDeviceConfigClient(ctx context.Context) (external.DeviceConfigClient, error)
GetDeviceConfigClient returns a client for reading DeviceConfigs.
func GetDeviceLabels ¶
GetDeviceLabels returns device label for the given id from datastore.
func GetDutAttribute ¶
GetDutAttribute returns DutAttribute for the given DutAttribute ID from datastore.
func GetDutState ¶
GetDutState returns the DutState for the ChromeOS device.
func GetHostData ¶
func GetHostData(ctx context.Context, serial string, full bool) (*ufspb.MachineLSE, *ufspb.Machine, error)
GetHostData returns all the data available for the given serial number. It returns Machine and error if MachineLSE query has an error.
func GetHwidClient ¶
func GetHwidClient(ctx context.Context) (hwid.ClientInterface, error)
GetHwidClient returns a client for interacting with HWID service
func GetHwidData ¶
func GetHwidData(ctx context.Context, c hwid.ClientInterface, hwid string) (data *ufspb.HwidData, err error)
GetHwidData takes an hwid and returns the Sku and Variant in the form of HwidData proto. It will try the following in order: 1. Query from datastore. If under an hour old, return data. 2. If over an hour old or no data in datastore, attempt to query new data from HWID server. 3. If HWID server data available, cache into datastore and return data. 4. If server fails, return expired datastore data if present. If not, return nil and error.
func GetMachine ¶
GetMachine returns machine for the given id from datastore.
func GetMachineLSE ¶
GetMachineLSE returns machinelse for the given id from datastore.
func GetMachineLSEBySerial ¶
func GetMachineLSEBySerial(ctx context.Context, serial string, full bool) (*ufspb.MachineLSE, error)
GetMachineLSEBySerial returns the machine_lse associated with the serial number of the machine.
func GetMachineLSEDeployment ¶
GetMachineLSEDeployment returns the deployment record for the given id.
func GetMachineLSELabels ¶
func GetMachineLSELabels(ctx context.Context, lse *ufspb.MachineLSE) (*ufspb.DeviceLabels, error)
func GetMachineLSEPrototype ¶
GetMachineLSEPrototype returns machinelseprototype for the given id from datastore.
func GetOwnershipData ¶
GetOwnershipData gets the ownership data in the Data store for the requested bot in the config.
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 GetSchedulingUnitLabels ¶
func GetSchedulingUnitLabels(ctx context.Context, su *ufspb.SchedulingUnit, lses []*ufspb.MachineLSE) (*ufspb.DeviceLabels, error)
func ImportBotConfigs ¶
ImportBotConfigs gets the OwnershipConfig and git client and passes them to functions for importing bot configs
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 ImportPublicBoardsAndModels ¶
func ImportPublicBoardsAndModels(ctx context.Context, goldenEyeDevices *ufspb.GoldenEyeDevices) error
func ImportSecurityConfig ¶
func ImportSecurityConfig(ctx context.Context, ownershipConfig *config.OwnershipConfig, gitClient git.ClientInterface) error
ImportSecurityConfig imports Security Config files and stores security data for each bot in the DataStore.
func IsValidTest ¶
func IsValidTest(ctx context.Context, req *api.CheckFleetTestsPolicyRequest) 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 ListDefaultWifis ¶
func ListDeviceLabels ¶
func ListDeviceLabels(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.DeviceLabels, string, error)
ListDeviceLabels lists the device labels TODO(echoyang@): Add realm permission checks for reading device labels
func ListDracs ¶
func ListDracs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.Drac, string, error)
ListDracs lists the dracs
func ListDutAttributes ¶
ListDutAttributes lists the DutAttributes from datastore.
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 ListHwidData ¶
func ListHwidData(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.HwidData, string, error)
ListHwidData lists the HwidData in datastore.
func ListIPs ¶
func ListIPs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*ufspb.IP, string, error)
ListIPs lists the ips
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 ListOwnershipConfigs ¶
func ListOwnershipConfigs(ctx context.Context, pageSize int32, pageToken, filter string, keysOnly bool) ([]*api.OwnershipByHost, string, error)
ListOwnershipConfigs lists the ownerships based on the specified parameters.
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 ParseSecurityConfig ¶
func ParseSecurityConfig(ctx context.Context, config *ufspb.SecurityInfos)
ParseSecurityConfig parses the Security Config files and stores the security data in the DataStore for every bot in the config.
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 RenameRack ¶
RenameRack renames a rack in datastore
All corresponding entities which are related to the old rack will be updated.
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 UpdateDefaultWifi ¶
func UpdateDefaultWifi(ctx context.Context, wifi *ufspb.DefaultWifi, mask *field_mask.FieldMask) (*ufspb.DefaultWifi, error)
UpdateDefaultWifi updates existing DefaultWifi in datastore.
func UpdateDeviceLabels ¶
func UpdateDeviceLabels(ctx context.Context, deviceLabels *ufspb.DeviceLabels, mask *field_mask.FieldMask) (*ufspb.DeviceLabels, error)
UpdateDeviceLabels updates an existing device label in datastore.
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 UpdateDutStateWithMasks ¶
func UpdateDutStateWithMasks(ctx context.Context, maskSet map[string]bool, ds *chromeosLab.DutState) (*chromeosLab.DutState, error)
UpdateDutStateWithMasks updates the dut state for a ChromeOS DUT by specified masks.
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 UpdateRecoveryData ¶
func UpdateRecoveryData(ctx context.Context, req *ufsAPI.UpdateDeviceRecoveryDataRequest) error
UpdateRecoveryData updates data from recovery It updates machine/asset, Peripherals(servo, wifirouter,...) and Dut's resourceState
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 UpdateTestData ¶
func UpdateTestData(ctx context.Context, req *ufsAPI.UpdateTestDataRequest) error
UpdateTestData updates data from test data. It updates only different type of states.
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 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) LogDeviceLabelsChanges ¶
func (hc *HistoryClient) LogDeviceLabelsChanges(oldData, newData *ufspb.DeviceLabels)
LogDeviceLabelsChanges logs the change of the given device labels.
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 InvalidBoardError ¶
type InvalidBoardError struct {
Board string
}
InvalidBoardError is the error raised when a private board is specified for a public test
func (*InvalidBoardError) Error ¶
func (e *InvalidBoardError) Error() string
type InvalidImageError ¶
type InvalidImageError struct {
Image string
}
InvalidImageError is the error raised when an invalid image is specified for a public test
func (*InvalidImageError) Error ¶
func (e *InvalidImageError) Error() string
type InvalidModelError ¶
type InvalidModelError struct {
Model string
}
InvalidModelError is the error raised when a private model is specified for a public test
func (*InvalidModelError) Error ¶
func (e *InvalidModelError) Error() string
type InvalidQsAccountError ¶
type InvalidQsAccountError struct {
QsAccount string
}
InvalidQsAccountError is the error raised when an invalid quota scheduler account is specified for a public test
func (*InvalidQsAccountError) Error ¶
func (e *InvalidQsAccountError) Error() string
type InvalidTestError ¶
type InvalidTestError struct {
TestName string
}
InvalidTestError is the error raised when an invalid image is specified for a public test
func (*InvalidTestError) Error ¶
func (e *InvalidTestError) Error() string
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 GetDefaultWifiResource ¶
GetDefaultWifiResource returns a Resource with DefaultWifiEntity.
func GetDeviceLabelsResource ¶
GetDeviceLabelsResource returns a Resource with DeviceLabelsEntity.
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
- bot_config_reader.go
- caching_service.go
- change.go
- change_helper.go
- chrome_platform.go
- config_bundle.go
- datacenter.go
- defaultwifi.go
- device_labels.go
- dhcp.go
- doc.go
- drac.go
- dut.go
- dut_attribute.go
- dut_state.go
- fleet_tests_policy.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
- pubsub_component.go
- rack.go
- rack_lse.go
- rack_lse_prototype.go
- rpm.go
- scheduling_unit.go
- state.go
- state_updater.go
- switch.go
- testing.go
- tle_converter.go
- vlan.go
- vm.go