ufs

package
v0.0.0-...-e560ebb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

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

func CopyInvV2DutMetaToUFSDutMeta(oldDm *api.DutMeta, hostname string) *ufspb.DutMeta

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

func CopyInvV2LabMetaToUFSLabMeta(oldLm *api.LabMeta, hostname string) *ufspb.LabMeta

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

func GetUFSClient(ctx context.Context) (external.UFSClient, error)

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

func SetupOSNameSpaceContext(ctx context.Context) context.Context

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

func GetAllUFSDevicesData(ctx context.Context, ufsClient external.UFSClient) ([]*DeviceData, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL