Documentation
¶
Index ¶
- Constants
- func BatchUpdateStates(ctx context.Context, states []*ufspb.StateRecord) ([]*ufspb.StateRecord, error)
- func DeleteDutStates(ctx context.Context, resourceNames []string) *ufsds.OpResults
- func DeleteStates(ctx context.Context, resourceNames []string) *ufsds.OpResults
- func GetAllDutStates(ctx context.Context) (*ufsds.OpResults, error)
- func GetAllStates(ctx context.Context) (*ufsds.OpResults, error)
- func GetDutState(ctx context.Context, id string) (*chromeosLab.DutState, error)
- func GetStateIndexedFieldName(input string) (string, error)
- func GetStateRecord(ctx context.Context, id string) (*ufspb.StateRecord, error)
- func ImportDutStates(ctx context.Context, dutStates []*chromeosLab.DutState) (*ufsds.OpResults, error)
- func ImportStateRecords(ctx context.Context, states []*ufspb.StateRecord) (*ufsds.OpResults, error)
- func ListAllDutStates(ctx context.Context, keysOnly bool) (res []*chromeosLab.DutState, err error)
- func ListDutStates(ctx context.Context, pageSize int32, pageToken string, ...) (res []*chromeosLab.DutState, nextPageToken string, err error)
- func ListStateRecords(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.StateRecord, nextPageToken string, err error)
- func QueryDutStateByPropertyNames(ctx context.Context, propertyMap map[string]string, keysOnly bool) ([]*chromeosLab.DutState, error)
- func UpdateDutStates(ctx context.Context, dutStates []*chromeosLab.DutState) ([]*chromeosLab.DutState, error)
- func UpdateStateRecord(ctx context.Context, stateRecord *ufspb.StateRecord) (*ufspb.StateRecord, error)
- type DutStateEntity
- type RecordEntity
Constants ¶
const DutStateKind string = "DutState"
DutStateKind is the datastore entity kind of dut state.
Dut state is only specific to OS devices for now.
const RecordKind string = "State"
RecordKind is the datastore entity kind of state.
Variables ¶
This section is empty.
Functions ¶
func BatchUpdateStates ¶
func BatchUpdateStates(ctx context.Context, states []*ufspb.StateRecord) ([]*ufspb.StateRecord, error)
BatchUpdateStates updates the states to UFS.
This can be used inside a transaction
func DeleteDutStates ¶
DeleteDutStates deletes a batch of dut states
func DeleteStates ¶
DeleteStates deletes a batch of states
func GetAllDutStates ¶
GetAllDutStates returns all dut states in datastore.
func GetAllStates ¶
GetAllStates returns all states in datastore.
func GetDutState ¶
GetDutState returns dut state for the given id from datastore.
func GetStateIndexedFieldName ¶
GetStateIndexedFieldName returns the index name
func GetStateRecord ¶
GetStateRecord returns the state for a given resource name.
func ImportDutStates ¶
func ImportDutStates(ctx context.Context, dutStates []*chromeosLab.DutState) (*ufsds.OpResults, error)
ImportDutStates creates or updates a batch of dut states in datastore
func ImportStateRecords ¶
ImportStateRecords creates or updates a batch of state records in datastore
func ListAllDutStates ¶
ListAllDutStates returns all DutState in datastore.
func ListDutStates ¶
func ListDutStates(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*chromeosLab.DutState, nextPageToken string, err error)
ListDutStates lists the DutStates.
Does a query over DutState entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.
func ListStateRecords ¶
func ListStateRecords(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}) (res []*ufspb.StateRecord, nextPageToken string, err error)
ListStateRecords lists all the states
func QueryDutStateByPropertyNames ¶
func QueryDutStateByPropertyNames(ctx context.Context, propertyMap map[string]string, keysOnly bool) ([]*chromeosLab.DutState, error)
QueryDutStateByPropertyNames queries DutState Entity in the datastore. If keysOnly is true, then only key field is populated in returned DutStates.
func UpdateDutStates ¶
func UpdateDutStates(ctx context.Context, dutStates []*chromeosLab.DutState) ([]*chromeosLab.DutState, error)
UpdateDutStates updates dut states in datastore.
func UpdateStateRecord ¶
func UpdateStateRecord(ctx context.Context, stateRecord *ufspb.StateRecord) (*ufspb.StateRecord, error)
UpdateStateRecord updates a state record in datastore.
Types ¶
type DutStateEntity ¶
type DutStateEntity struct { // refer to the device id ID string `gae:"$id"` Hostname string `gae:"hostname"` // lab.DutState cannot be directly used as it contains pointer (timestamp). DutState []byte `gae:",noindex"` // contains filtered or unexported fields }
DutStateEntity is a datastore entity that tracks dut state.
type RecordEntity ¶
type RecordEntity struct { // refer to the hostname ResourceName string `gae:"$id"` ResourceType string `gae:"resource_type"` State string `gae:"state"` // ufspb.StateRecord cannot be directly used as it contains pointer (timestamp). StateRecord []byte `gae:",noindex"` // contains filtered or unexported fields }
RecordEntity is a datastore entity that tracks dhcp.