Documentation ¶
Index ¶
- func ConstructInvV2Device(machine *ufspb.Machine, lse *ufspb.MachineLSE) *lab.ChromeOSDevice
- func CopyInvV2DutMetaToUFSDutMeta(oldDm *api.DutMeta, hostname string) *ufspb.DutMeta
- func CopyInvV2DutStateToUFSDutState(oldS *lab.DutState, hostname string) *ufschromeoslab.DutState
- func CopyInvV2LabMetaToUFSLabMeta(oldLm *api.LabMeta, hostname string) *ufspb.LabMeta
- func CopyUFSDutStateToInvV2DutState(oldS *ufschromeoslab.DutState) *lab.DutState
- func CopyUFSDutToInvV2Dut(dut *ufschromeoslab.DeviceUnderTest) *lab.DeviceUnderTest
- func CopyUFSLabstationToInvV2Labstation(labstation *ufschromeoslab.Labstation) *lab.Labstation
- func CreateMachineLSEs(iv2ctx context.Context, devices []*lab.ChromeOSDevice, pickServoPort bool) *api.AddCrosDevicesResponse
- func DeleteMachineLSEs(iv2ctx context.Context, hosts []*api.DeviceID) *api.DeleteCrosDevicesResponse
- func GetAssets(iv2ctx context.Context, identifiers []string) *api.AssetResponse
- func GetUFSClient(ctx context.Context) (external.UFSClient, error)
- func GetUFSDevicesByHostnames(ctx context.Context, ufsClient external.UFSClient, names []string) ([]*lab.ChromeOSDevice, []*api.DeviceOpResult)
- func GetUFSDevicesByIds(ctx context.Context, ufsClient external.UFSClient, ids []string) ([]*lab.ChromeOSDevice, []*api.DeviceOpResult)
- func GetUFSDevicesByModels(ctx context.Context, ufsClient external.UFSClient, models []string) ([]*lab.ChromeOSDevice, []*api.DeviceOpResult)
- func GetUFSDutStateForDevices(ctx context.Context, ufsClient external.UFSClient, ...) ([]*api.ExtendedDeviceData, []*api.DeviceOpResult)
- func SetupOSNameSpaceContext(ctx context.Context) context.Context
- func UpdateAssets(iv2ctx context.Context, assets []*chopsasset.ChopsAsset) *api.AssetResponse
- func UpdateMachineLSEs(iv2ctx context.Context, devices []*lab.ChromeOSDevice, reason string, ...) *api.UpdateCrosDevicesSetupResponse
- func UpdateMachineLSEsBatch(iv2ctx context.Context, req *api.BatchUpdateDevicesRequest) (err error)
- func UpdateUFSDutState(ctx context.Context, req *api.UpdateDutsStatusRequest) ([]*api.DeviceOpResult, []*api.DeviceOpResult, error)
- type DeviceData
- type DutStateData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructInvV2Device ¶
func ConstructInvV2Device(machine *ufspb.Machine, lse *ufspb.MachineLSE) *lab.ChromeOSDevice
ConstructInvV2Device constructs a InvV2 Device from UFs MachineLSE and Machine.
func CopyInvV2DutMetaToUFSDutMeta ¶
CopyInvV2DutMetaToUFSDutMeta converts InvV2 DutMeta to UFS DutMeta
func CopyInvV2DutStateToUFSDutState ¶
func CopyInvV2DutStateToUFSDutState(oldS *lab.DutState, hostname string) *ufschromeoslab.DutState
CopyInvV2DutStateToUFSDutState converts InvV2 DutState to UFS DutState
func CopyInvV2LabMetaToUFSLabMeta ¶
CopyInvV2LabMetaToUFSLabMeta converts InvV2 LabMeta to UFS LabMeta
func CopyUFSDutStateToInvV2DutState ¶
func CopyUFSDutStateToInvV2DutState(oldS *ufschromeoslab.DutState) *lab.DutState
CopyUFSDutStateToInvV2DutState converts UFS DutState to InvV2 DutState proto format.
func CopyUFSDutToInvV2Dut ¶
func CopyUFSDutToInvV2Dut(dut *ufschromeoslab.DeviceUnderTest) *lab.DeviceUnderTest
CopyUFSDutToInvV2Dut converts UFS DUT to InvV2 DUT proto format.
func CopyUFSLabstationToInvV2Labstation ¶
func CopyUFSLabstationToInvV2Labstation(labstation *ufschromeoslab.Labstation) *lab.Labstation
CopyUFSLabstationToInvV2Labstation converts UFS Labstation to InvV2 Labstation proto format.
func CreateMachineLSEs ¶
func CreateMachineLSEs(iv2ctx context.Context, devices []*lab.ChromeOSDevice, pickServoPort bool) *api.AddCrosDevicesResponse
CreateMachineLSEs creates machine LSEs in UFS from given cros devices and returns AddCrosDevicesResponse. Intended to be used in piping IV2 API to UFS.
func DeleteMachineLSEs ¶
func DeleteMachineLSEs(iv2ctx context.Context, hosts []*api.DeviceID) *api.DeleteCrosDevicesResponse
DeleteMachineLSEs removes multiple machine lses from UFS and returns DeleteCrosDevicesResponse. Used to pipe DeleteCrosDevices API to UFS.
func GetAssets ¶
func GetAssets(iv2ctx context.Context, identifiers []string) *api.AssetResponse
GetAssets retrieves asset data from UFS. To be used to pipe GetAssets API to UFS.
func GetUFSClient ¶
GetUFSClient gets the UFS clien.
func GetUFSDevicesByHostnames ¶
func GetUFSDevicesByHostnames(ctx context.Context, ufsClient external.UFSClient, names []string) ([]*lab.ChromeOSDevice, []*api.DeviceOpResult)
GetUFSDevicesByHostnames Gets MachineLSEs from UFS by MachineLSE name/hostname.
func GetUFSDevicesByIds ¶
func GetUFSDevicesByIds(ctx context.Context, ufsClient external.UFSClient, ids []string) ([]*lab.ChromeOSDevice, []*api.DeviceOpResult)
GetUFSDevicesByIds Gets MachineLSEs from UFS by Asset id/Machine id.
func GetUFSDevicesByModels ¶
func GetUFSDevicesByModels(ctx context.Context, ufsClient external.UFSClient, models []string) ([]*lab.ChromeOSDevice, []*api.DeviceOpResult)
GetUFSDevicesByModels Gets MachineLSEs from UFS by Asset/Machine model.
func GetUFSDutStateForDevices ¶
func GetUFSDutStateForDevices(ctx context.Context, ufsClient external.UFSClient, devices []*lab.ChromeOSDevice) ([]*api.ExtendedDeviceData, []*api.DeviceOpResult)
GetUFSDutStateForDevices Gets DutStates from UFS by Asset id/Machine id.
func SetupOSNameSpaceContext ¶
SetupOSNameSpaceContext sets up context with namespace
func UpdateAssets ¶
func UpdateAssets(iv2ctx context.Context, assets []*chopsasset.ChopsAsset) *api.AssetResponse
UpdateAssets updates the asset location to UFS. To be used to pipe UpdateAssets API to UFS.
func UpdateMachineLSEs ¶
func UpdateMachineLSEs(iv2ctx context.Context, devices []*lab.ChromeOSDevice, reason string, pickServoPort bool) *api.UpdateCrosDevicesSetupResponse
UpdateMachineLSEs updates the ChromeOSDevices to UFS and returns the CrosUpdateDevicesSetupResponse. This is intended to be used to route the UpdateCrosDevicesSetup API to UFS.
func UpdateMachineLSEsBatch ¶
func UpdateMachineLSEsBatch(iv2ctx context.Context, req *api.BatchUpdateDevicesRequest) (err error)
UpdateMachineLSEsBatch impersonates a batch update function. For use in piping BatchUpdateDevices API to UFS.
func UpdateUFSDutState ¶
func UpdateUFSDutState(ctx context.Context, req *api.UpdateDutsStatusRequest) ([]*api.DeviceOpResult, []*api.DeviceOpResult, error)
UpdateUFSDutState updates dutmeta, labmeta and dutstate in UFS
Types ¶
type DeviceData ¶
type DeviceData struct { Device *lab.ChromeOSDevice UpdateTime *timestamppb.Timestamp }
DeviceData holds the invV2 Device and updatetime(of MachineLSE)
func GetAllUFSDevicesData ¶
GetAllUFSDevicesData Gets all the MachineLSEs and Machines from UFS and returns invV2 Devices and updatedtime.
type DutStateData ¶
type DutStateData struct { DutState *lab.DutState UpdateTime *timestamppb.Timestamp }
DutStateData holds the invV2 DutState and updatetime
func GetAllUFSDutStatesData ¶
func GetAllUFSDutStatesData(ctx context.Context, ufsClient external.UFSClient) ([]*DutStateData, error)
GetAllUFSDutStatesData Gets all the DutStateLSEs and DutStates from UFS and returns invV2 DutStates and updatedtime.