registration

package
v0.0.0-...-7f005ae Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package registration provides interfaces for managing DataStore entities that correspond to physical devices

Index

Constants

View Source
const AssetKind string = "Asset"

AssetKind is a datastore entity identifier for Asset

View Source
const DefaultWifiKind string = "DefaultWifi"

DefaultWifiKind is the datastore entity kind DefaultWifi.

View Source
const DracKind string = "Drac"

DracKind is the datastore entity kind Drac.

View Source
const KVMKind string = "KVM"

KVMKind is the datastore entity kind KVM.

View Source
const MachineKind string = "Machine"

MachineKind is the datastore entity kind Machine.

View Source
const NicKind string = "Nic"

NicKind is the datastore entity kind Nic.

View Source
const RPMKind string = "RPM"

RPMKind is the datastore entity kind RPM.

View Source
const RackKind string = "Rack"

RackKind is the datastore entity kind Rack.

View Source
const SwitchKind string = "Switch"

SwitchKind is the datastore entity kind Switch.

Variables

This section is empty.

Functions

func BatchDeleteKVMs

func BatchDeleteKVMs(ctx context.Context, ids []string) error

BatchDeleteKVMs deletes kvms in datastore.

This is a non-atomic operation. Must be used within a transaction. Will lead to partial deletes if not used in a transaction.

func BatchDeleteNics

func BatchDeleteNics(ctx context.Context, ids []string) error

BatchDeleteNics deletes nics in datastore.

This is a non-atomic operation. Must be used within a transaction. Will lead to partial deletes if not used in a transaction.

func BatchDeleteRPMs

func BatchDeleteRPMs(ctx context.Context, ids []string) error

BatchDeleteRPMs deletes rpms in datastore.

This is a non-atomic operation. Must be used within a transaction. Will lead to partial deletes if not used in a transaction.

func BatchDeleteSwitches

func BatchDeleteSwitches(ctx context.Context, ids []string) error

BatchDeleteSwitches deletes switches in datastore.

This is a non-atomic operation. Must be used within a transaction. Will lead to partial deletes if not used in a transaction.

func BatchGetDracs

func BatchGetDracs(ctx context.Context, ids []string) ([]*ufspb.Drac, error)

BatchGetDracs returns a batch of dracs from datastore.

func BatchGetKVM

func BatchGetKVM(ctx context.Context, ids []string) ([]*ufspb.KVM, error)

BatchGetKVM returns a batch of KVMs from datastore.

func BatchGetMachinesACL

func BatchGetMachinesACL(ctx context.Context, ids []string) ([]*ufspb.Machine, error)

BatchGetMachinesACL routes the request to either the ACLed or unACLed method depending on the rollout status.

func BatchGetNics

func BatchGetNics(ctx context.Context, ids []string) ([]*ufspb.Nic, error)

BatchGetNics returns a batch of nics from datastore.

func BatchGetRPMs

func BatchGetRPMs(ctx context.Context, ids []string) ([]*ufspb.RPM, error)

BatchGetRPMs returns a batch of rpms from datastore.

func BatchGetRacks

func BatchGetRacks(ctx context.Context, ids []string) ([]*ufspb.Rack, error)

BatchGetRacks returns a batch of racks from datastore.

func BatchGetRacksACL

func BatchGetRacksACL(ctx context.Context, ids []string) ([]*ufspb.Rack, error)

BatchGetRacksACL returns a batch of racks after potentially checking for ACLs in the relevant realms.

func BatchGetSwitches

func BatchGetSwitches(ctx context.Context, ids []string) ([]*ufspb.Switch, error)

BatchGetSwitches returns a batch of switches from datastore.

func BatchUpdateAssets

func BatchUpdateAssets(ctx context.Context, assets []*ufspb.Asset) ([]*ufspb.Asset, error)

BatchUpdateAssets updates the assets to the datastore

func BatchUpdateDracs

func BatchUpdateDracs(ctx context.Context, dracs []*ufspb.Drac) ([]*ufspb.Drac, error)

BatchUpdateDracs updates dracs in datastore.

This is a non-atomic operation and doesnt check if the object already exists before update. Must be used within a Transaction where objects are checked before update. Will lead to partial updates if not used in a transaction.

func BatchUpdateKVMs

func BatchUpdateKVMs(ctx context.Context, kvms []*ufspb.KVM) ([]*ufspb.KVM, error)

BatchUpdateKVMs updates kvms in datastore.

This is a non-atomic operation and doesnt check if the object already exists before update. Must be used within a Transaction where objects are checked before update. Will lead to partial updates if not used in a transaction.

func BatchUpdateMachines

func BatchUpdateMachines(ctx context.Context, machines []*ufspb.Machine) ([]*ufspb.Machine, error)

BatchUpdateMachines updates machines in datastore.

This is a non-atomic operation and doesnt check if the object already exists before update. Must be used within a Transaction where objects are checked before update. Will lead to partial updates if not used in a transaction.

func BatchUpdateNics

func BatchUpdateNics(ctx context.Context, nics []*ufspb.Nic) ([]*ufspb.Nic, error)

BatchUpdateNics updates nics in datastore.

This is a non-atomic operation and doesnt check if the object already exists before update. Must be used within a Transaction where objects are checked before update. Will lead to partial updates if not used in a transaction.

func BatchUpdateRPMs

func BatchUpdateRPMs(ctx context.Context, rpms []*ufspb.RPM) ([]*ufspb.RPM, error)

BatchUpdateRPMs updates rpms in datastore.

This is a non-atomic operation and doesnt check if the object already exists before update. Must be used within a Transaction where objects are checked before update. Will lead to partial updates if not used in a transaction.

func BatchUpdateRacks

func BatchUpdateRacks(ctx context.Context, racks []*ufspb.Rack) ([]*ufspb.Rack, error)

BatchUpdateRacks updates racks in datastore.

This is a non-atomic operation and doesnt check if the object already exists before update. Must be used within a Transaction where objects are checked before update. Will lead to partial updates if not used in a transaction.

func BatchUpdateSwitches

func BatchUpdateSwitches(ctx context.Context, switches []*ufspb.Switch) ([]*ufspb.Switch, error)

BatchUpdateSwitches updates switches in datastore.

This is a non-atomic operation and doesnt check if the object already exists before update. Must be used within a Transaction where objects are checked before update. Will lead to partial updates if not used in a transaction.

func CreateAsset

func CreateAsset(ctx context.Context, asset *ufspb.Asset) (*ufspb.Asset, error)

CreateAsset creates an asset record in the datastore using the given asset proto.

func CreateDrac

func CreateDrac(ctx context.Context, drac *ufspb.Drac) (*ufspb.Drac, error)

CreateDrac creates a new drac in datastore.

func CreateKVM

func CreateKVM(ctx context.Context, KVM *ufspb.KVM) (*ufspb.KVM, error)

CreateKVM creates a new KVM in datastore.

func CreateMachine

func CreateMachine(ctx context.Context, machine *ufspb.Machine) (*ufspb.Machine, error)

CreateMachine creates a new machine in datastore.

func CreateNic

func CreateNic(ctx context.Context, nic *ufspb.Nic) (*ufspb.Nic, error)

CreateNic creates a new nic in datastore.

func CreateRPM

func CreateRPM(ctx context.Context, RPM *ufspb.RPM) (*ufspb.RPM, error)

CreateRPM creates a new RPM in datastore.

func CreateRack

func CreateRack(ctx context.Context, rack *ufspb.Rack) (*ufspb.Rack, error)

CreateRack creates a new rack in datastore.

func CreateSwitch

func CreateSwitch(ctx context.Context, s *ufspb.Switch) (*ufspb.Switch, error)

CreateSwitch creates a new switch in datastore.

func DeleteAsset

func DeleteAsset(ctx context.Context, id string) error

DeleteAsset deletes the asset corresponding to id from datastore.

func DeleteDefaultWifi

func DeleteDefaultWifi(ctx context.Context, name string) error

DeleteDefaultWifi deletes the DefaultWifi in datastore.

func DeleteDrac

func DeleteDrac(ctx context.Context, id string) error

DeleteDrac deletes the drac in datastore

func DeleteDracs

func DeleteDracs(ctx context.Context, resourceNames []string) *ufsds.OpResults

DeleteDracs deletes a batch of dracs

func DeleteKVM

func DeleteKVM(ctx context.Context, id string) error

DeleteKVM deletes the KVM in datastore

func DeleteKVMs

func DeleteKVMs(ctx context.Context, resourceNames []string) *ufsds.OpResults

DeleteKVMs deletes a batch of kvms

func DeleteMachine

func DeleteMachine(ctx context.Context, id string) error

DeleteMachine deletes the machine in datastore

func DeleteMachines

func DeleteMachines(ctx context.Context, resourceNames []string) *ufsds.OpResults

DeleteMachines deletes a batch of machines

func DeleteNic

func DeleteNic(ctx context.Context, id string) error

DeleteNic deletes the nic in datastore

func DeleteNics

func DeleteNics(ctx context.Context, resourceNames []string) *ufsds.OpResults

DeleteNics deletes a batch of nics

func DeleteRPM

func DeleteRPM(ctx context.Context, id string) error

DeleteRPM deletes the RPM in datastore

func DeleteRack

func DeleteRack(ctx context.Context, id string) error

DeleteRack deletes the rack in datastore

func DeleteRacks

func DeleteRacks(ctx context.Context, resourceNames []string) *ufsds.OpResults

DeleteRacks deletes a batch of racks

func DeleteSwitch

func DeleteSwitch(ctx context.Context, id string) error

DeleteSwitch deletes the switch in datastore

func DeleteSwitches

func DeleteSwitches(ctx context.Context, resourceNames []string) *ufsds.OpResults

DeleteSwitches deletes a batch of switches

func GetAllAssets

func GetAllAssets(ctx context.Context) ([]*ufspb.Asset, error)

GetAllAssets returns all assets currently in the datastore.

func GetAllDracs

func GetAllDracs(ctx context.Context) (*ufsds.OpResults, error)

GetAllDracs returns all dracs in datastore.

func GetAllKVMs

func GetAllKVMs(ctx context.Context) (*ufsds.OpResults, error)

GetAllKVMs returns all kvms in datastore.

func GetAllNics

func GetAllNics(ctx context.Context) (*ufsds.OpResults, error)

GetAllNics returns all nics in datastore.

func GetAllRacks

func GetAllRacks(ctx context.Context) (*ufsds.OpResults, error)

GetAllRacks returns all racks in datastore.

func GetAllSwitches

func GetAllSwitches(ctx context.Context) (*ufsds.OpResults, error)

GetAllSwitches returns all switches in datastore.

func GetAsset

func GetAsset(ctx context.Context, name string) (*ufspb.Asset, error)

GetAsset returns asset corresponding to the name.

func GetAssetACL

func GetAssetACL(ctx context.Context, id string) (*ufspb.Asset, error)

GetAssetACL routes the request to either the ACLed or unACLed method depending on the rollout status.

func GetAssetIndexedFieldName

func GetAssetIndexedFieldName(input string) (string, error)

GetAssetIndexedFieldName returns the index name

func GetDefaultWifi

func GetDefaultWifi(ctx context.Context, name string) (*ufspb.DefaultWifi, error)

GetDefaultWifi returns the specified default wifi.

func GetDrac

func GetDrac(ctx context.Context, id string) (*ufspb.Drac, error)

GetDrac returns drac for the given id from datastore.

func GetDracIndexedFieldName

func GetDracIndexedFieldName(input string) (string, error)

GetDracIndexedFieldName returns the index name

func GetKVM

func GetKVM(ctx context.Context, id string) (*ufspb.KVM, error)

GetKVM returns KVM for the given id from datastore.

func GetKVMIndexedFieldName

func GetKVMIndexedFieldName(input string) (string, error)

GetKVMIndexedFieldName returns the index name

func GetMachine

func GetMachine(ctx context.Context, id string) (*ufspb.Machine, error)

GetMachine returns machine for the given id from datastore.

func GetMachineACL

func GetMachineACL(ctx context.Context, id string) (*ufspb.Machine, error)

GetMachineACL routes the request to either the ACLed or unACLed method depending on the rollout status.

func GetMachineIndexedFieldName

func GetMachineIndexedFieldName(input string) (string, error)

GetMachineIndexedFieldName returns the index name

func GetNic

func GetNic(ctx context.Context, id string) (*ufspb.Nic, error)

GetNic returns nic for the given id from datastore.

func GetNicIndexedFieldName

func GetNicIndexedFieldName(input string) (string, error)

GetNicIndexedFieldName returns the index name

func GetRPM

func GetRPM(ctx context.Context, id string) (*ufspb.RPM, error)

GetRPM returns RPM for the given id from datastore.

func GetRPMIndexedFieldName

func GetRPMIndexedFieldName(input string) (string, error)

GetRPMIndexedFieldName returns the index name

func GetRack

func GetRack(ctx context.Context, id string) (*ufspb.Rack, error)

GetRack returns rack for the given id from datastore.

func GetRackACL

func GetRackACL(ctx context.Context, id string) (*ufspb.Rack, error)

GetRackACL returns a rack for the given id from datastore if the context contains a user who has registration.get perms in the rack's realm.

Temporarily may return a result without checking realm permissions if the service is not configured to always check ACLs.

func GetRackIndexedFieldName

func GetRackIndexedFieldName(input string) (string, error)

GetRackIndexedFieldName returns the index name

func GetSwitch

func GetSwitch(ctx context.Context, id string) (*ufspb.Switch, error)

GetSwitch returns switch for the given id from datastore.

func GetSwitchIndexedFieldName

func GetSwitchIndexedFieldName(input string) (string, error)

GetSwitchIndexedFieldName returns the index name

func ListAssets

func ListAssets(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.Asset, nextPageToken string, err error)

ListAssets lists the assets Does a query over asset entities. Returns pageSize number of entities and a non-nil cursor if there are more results. pageSize must be positive

func ListAssetsACL

func ListAssetsACL(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.Asset, nextPageToken string, err error)

ListAssetsACL lists the assets that are visible to the user. Does a query over asset entities. Returns pageSize number of entities and a non-nil cursor if there are more results. pageSize must be positive.

func ListDracs

func ListDracs(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.Drac, nextPageToken string, err error)

ListDracs lists the dracs

Does a query over Drac entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.

func ListKVMs

func ListKVMs(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.KVM, nextPageToken string, err error)

ListKVMs lists the KVMs

Does a query over KVM entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.

func ListMachines

func ListMachines(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.Machine, nextPageToken string, err error)

ListMachines lists the machines Does a query over Machine entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.

func ListMachinesACL

func ListMachinesACL(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.Machine, nextPageToken string, err error)

ListMachinesACL lists the machines in a realm the user has permission to view.

Does a query over Machine entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.

func ListMachinesByIdPrefixSearch

func ListMachinesByIdPrefixSearch(ctx context.Context, pageSize int32, pageToken string, prefix string, keysOnly bool) (res []*ufspb.Machine, nextPageToken string, err error)

ListMachinesByIdPrefixSearch lists the machines Does a query over Machine entities using ID prefix. Returns up to pageSize entities, plus non-nil cursor (if there are more results). PageSize must be positive. Note- currently not ACLed, so should not be used for user-facing tasks without other ACLs upstream.

func ListNics

func ListNics(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.Nic, nextPageToken string, err error)

ListNics lists the nics

Does a query over Nic entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.

func ListRPMs

func ListRPMs(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.RPM, nextPageToken string, err error)

ListRPMs lists the RPMs

Does a query over RPM entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.

func ListRacks

func ListRacks(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.Rack, nextPageToken string, err error)

ListRacks lists the racks Does a query over Rack entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.

func ListRacksACL

func ListRacksACL(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.Rack, nextPageToken string, err error)

ListRacksACL lists the racks in realms user can access. Does a query over Rack entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.

func ListSwitches

func ListSwitches(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.Switch, nextPageToken string, err error)

ListSwitches lists the switches

Does a query over switch entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.

func NonAtomicBatchCreateDefaultWifis

func NonAtomicBatchCreateDefaultWifis(ctx context.Context, wifis []*ufspb.DefaultWifi) ([]*ufspb.DefaultWifi, error)

NonAtomicBatchCreateDefaultWifis updates wifis in datastore in a non-atomic operation.

func NonAtomicBatchUpdateDefaultWifis

func NonAtomicBatchUpdateDefaultWifis(ctx context.Context, wifis []*ufspb.DefaultWifi) ([]*ufspb.DefaultWifi, error)

NonAtomicBatchUpdateDefaultWifis updates DefaultWifis in datastore.

func QueryAssetByPropertyName

func QueryAssetByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.Asset, error)

QueryAssetByPropertyName queries Asset Entity in the datastore If keysOnly is true, then only key field is populated in returned assets

func QueryDracByPropertyName

func QueryDracByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.Drac, error)

QueryDracByPropertyName query's Drac Entity in the datastore

If keysOnly is true, then only key field is populated in returned dracs

func QueryKVMByPropertyName

func QueryKVMByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.KVM, error)

QueryKVMByPropertyName query's KVM Entity in the datastore

If keysOnly is true, then only key field is populated in returned kvms

func QueryMachineByPropertyName

func QueryMachineByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.Machine, error)

QueryMachineByPropertyName queries Machine Entity in the datastore If keysOnly is true, then only key field is populated in returned machines. Note that read realm ACLs are not enforced so this is not appropriate for use without some other ACL being enforced beforehand.

func QueryNicByPropertyName

func QueryNicByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.Nic, error)

QueryNicByPropertyName query's Nic Entity in the datastore

If keysOnly is true, then only key field is populated in returned nics

func QueryRPMByPropertyName

func QueryRPMByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.RPM, error)

QueryRPMByPropertyName query's RPM Entity in the datastore

If keysOnly is true, then only key field is populated in returned rpms

func QueryRackByPropertyName

func QueryRackByPropertyName(ctx context.Context, propertyName string, id interface{}, keysOnly bool) ([]*ufspb.Rack, error)

QueryRackByPropertyName queries Rack Entity in the datastore

If keysOnly is true, then only key field is populated in returned racks. Note that this is not ACLed and should not be used to return results directly to users without ACLs being checked somewhere upstream.

func QuerySwitchByPropertyName

func QuerySwitchByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.Switch, error)

QuerySwitchByPropertyName query's Switch Entity in the datastore

If keysOnly is true, then only key field is populated in returned switches

func UpdateAsset

func UpdateAsset(ctx context.Context, asset *ufspb.Asset) (*ufspb.Asset, error)

UpdateAsset updates the asset to the given asset proto.

func UpdateDrac

func UpdateDrac(ctx context.Context, drac *ufspb.Drac) (*ufspb.Drac, error)

UpdateDrac updates drac in datastore.

func UpdateKVM

func UpdateKVM(ctx context.Context, KVM *ufspb.KVM) (*ufspb.KVM, error)

UpdateKVM updates KVM in datastore.

func UpdateMachine

func UpdateMachine(ctx context.Context, machine *ufspb.Machine) (*ufspb.Machine, error)

UpdateMachine updates machine in datastore.

func UpdateMachineOwnership

func UpdateMachineOwnership(ctx context.Context, id string, ownership *ufspb.OwnershipData) (*ufspb.Machine, error)

UpdateMachineOwnership updates machine ownership in datastore.

func UpdateNic

func UpdateNic(ctx context.Context, nic *ufspb.Nic) (*ufspb.Nic, error)

UpdateNic updates nic in datastore.

func UpdateRPM

func UpdateRPM(ctx context.Context, RPM *ufspb.RPM) (*ufspb.RPM, error)

UpdateRPM updates RPM in datastore.

func UpdateRack

func UpdateRack(ctx context.Context, rack *ufspb.Rack) (*ufspb.Rack, error)

UpdateRack updates rack in datastore.

func UpdateSwitch

func UpdateSwitch(ctx context.Context, s *ufspb.Switch) (*ufspb.Switch, error)

UpdateSwitch updates switch in datastore.

Types

type AssetEntity

type AssetEntity struct {
	Extra       datastore.PropertyMap `gae:",extra"`
	Name        string                `gae:"$id"`
	Zone        string                `gae:"zone"`
	Type        string                `gae:"type"`
	Model       string                `gae:"model"`
	Rack        string                `gae:"rack"`
	BuildTarget string                `gae:"build_target"`
	Phase       string                `gae:"phase"`
	Tags        []string              `gae:"tags"`
	Realm       string                `gae:"realm"`
	Asset       []byte                `gae:",noindex"` // Marshalled Asset proto
	// contains filtered or unexported fields
}

AssetEntity is a datastore entity that tracks Assets

func (*AssetEntity) GetProto

func (a *AssetEntity) GetProto() (proto.Message, error)

GetProto returns unmarshalled Asset.

func (*AssetEntity) GetRealm

func (a *AssetEntity) GetRealm() string

func (*AssetEntity) Validate

func (a *AssetEntity) Validate() error

Validate returns whether an AssetEntity is valid.

type DefaultWifiEntry

type DefaultWifiEntry struct {
	Extra datastore.PropertyMap `gae:",extra"`
	ID    string                `gae:"$id"`
	// ufspb.DefaultWifi cannot be directly used as it contains pointer.
	DefaultWifi []byte `gae:",noindex"`
	// contains filtered or unexported fields
}

DefaultWifiEntry is a datastore entity that tracks DefaultWifi.

func (*DefaultWifiEntry) GetProto

func (e *DefaultWifiEntry) GetProto() (proto.Message, error)

GetProto returns the unmarshaled DefaultWifi.

func (*DefaultWifiEntry) Validate

func (e *DefaultWifiEntry) Validate() error

Validate returns whether an DefaultWifiEntry is valid.

type DracEntity

type DracEntity struct {
	Extra      datastore.PropertyMap `gae:",extra"`
	ID         string                `gae:"$id"`
	SwitchID   string                `gae:"switch_id"`
	Lab        string                `gae:"lab"` // deprecated
	Zone       string                `gae:"zone"`
	Machine    string                `gae:"machine"`
	Rack       string                `gae:"rack"`
	Tags       []string              `gae:"tags"`
	MacAddress string                `gae:"mac_address"`
	SwitchPort string                `gae:"switch_port"`
	// ufspb.Drac cannot be directly used as it contains pointer.
	Drac []byte `gae:",noindex"`
	// contains filtered or unexported fields
}

DracEntity is a datastore entity that tdracs Drac.

func (*DracEntity) GetProto

func (e *DracEntity) GetProto() (proto.Message, error)

GetProto returns the unmarshaled Drac.

func (*DracEntity) Validate

func (e *DracEntity) Validate() error

Validate returns whether a DracEntity is valid.

type KVMEntity

type KVMEntity struct {
	Extra            datastore.PropertyMap `gae:",extra"`
	ID               string                `gae:"$id"`
	ChromePlatformID string                `gae:"chrome_platform_id"`
	Lab              string                `gae:"lab"` // deprecated
	Zone             string                `gae:"zone"`
	Rack             string                `gae:"rack"`
	Tags             []string              `gae:"tags"`
	MacAddress       string                `gae:"mac_address"`
	State            string                `gae:"state"`
	// ufspb.KVM cannot be directly used as it contains pointer.
	KVM []byte `gae:",noindex"`
	// contains filtered or unexported fields
}

KVMEntity is a datastore entity that tracks KVM.

func (*KVMEntity) GetProto

func (e *KVMEntity) GetProto() (proto.Message, error)

GetProto returns the unmarshaled KVM.

func (*KVMEntity) Validate

func (e *KVMEntity) Validate() error

Validate returns whether a KVMEntity is valid.

type MachineEntity

type MachineEntity struct {
	Extra datastore.PropertyMap `gae:",extra"`
	// ufspb.Machine.Name
	ID               string   `gae:"$id"`
	SerialNumber     string   `gae:"serial_number"`
	AssetTag         string   `gae:"asset_tag"`
	KVMID            string   `gae:"kvm_id"`
	KVMPort          string   `gae:"kvm_port"`
	RPMID            string   `gae:"rpm_id"`
	NicIDs           []string `gae:"nic_ids"` // deprecated. Do not use.
	DracID           string   `gae:"drac_id"` // deprecated. Do not use.
	ChromePlatformID string   `gae:"chrome_platform_id"`
	Rack             string   `gae:"rack"`
	Lab              string   `gae:"lab"` // deprecated
	Zone             string   `gae:"zone"`
	Tags             []string `gae:"tags"`
	State            string   `gae:"state"`
	Model            string   `gae:"model"`
	BuildTarget      string   `gae:"build_target"`
	DeviceType       string   `gae:"device_type"`
	Phase            string   `gae:"phase"`
	Pool             string   `gae:"pool"`
	SwarmingServer   string   `gae:"swarming_server"`
	Customer         string   `gae:"customer"`
	SecurityLevel    string   `gae:"security_level"`
	MibaRealm        string   `gae:"miba_realm,noindex"` // deprecated
	GPN              string   `gae:"gpn"`
	Realm            string   `gae:"realm"`
	// ufspb.Machine cannot be directly used as it contains pointer.
	Machine []byte `gae:",noindex"`
	// contains filtered or unexported fields
}

MachineEntity is a datastore entity that tracks Machine.

func (*MachineEntity) GetProto

func (e *MachineEntity) GetProto() (proto.Message, error)

GetProto returns the unmarshaled Machine.

func (*MachineEntity) GetRealm

func (e *MachineEntity) GetRealm() string

func (*MachineEntity) Validate

func (e *MachineEntity) Validate() error

Validate returns whether a MachineEntity is valid.

type NicEntity

type NicEntity struct {
	Extra      datastore.PropertyMap `gae:",extra"`
	ID         string                `gae:"$id"`
	SwitchID   string                `gae:"switch_id"`
	Lab        string                `gae:"lab"` // deprecated
	Zone       string                `gae:"zone"`
	Machine    string                `gae:"machine"`
	Rack       string                `gae:"rack"`
	Tags       []string              `gae:"tags"`
	MacAddress string                `gae:"mac_address"`
	SwitchPort string                `gae:"switch_port"`
	// ufspb.Nic cannot be directly used as it contains pointer.
	Nic []byte `gae:",noindex"`
	// contains filtered or unexported fields
}

NicEntity is a datastore entity that tnics Nic.

func (*NicEntity) GetProto

func (e *NicEntity) GetProto() (proto.Message, error)

GetProto returns the unmarshaled Nic.

func (*NicEntity) Validate

func (e *NicEntity) Validate() error

Validate returns whether a NicEntity is valid.

type RPMEntity

type RPMEntity struct {
	Extra      datastore.PropertyMap `gae:",extra"`
	ID         string                `gae:"$id"`
	Lab        string                `gae:"lab"` // deprecated
	Zone       string                `gae:"zone"`
	Rack       string                `gae:"rack"`
	Tags       []string              `gae:"tags"`
	MacAddress string                `gae:"mac_address"`
	State      string                `gae:"state"`
	// ufspb.RPM cannot be directly used as it contains pointer.
	RPM []byte `gae:",noindex"`
	// contains filtered or unexported fields
}

RPMEntity is a datastore entity that tracks RPM.

func (*RPMEntity) GetProto

func (e *RPMEntity) GetProto() (proto.Message, error)

GetProto returns the unmarshaled RPM.

func (*RPMEntity) Validate

func (e *RPMEntity) Validate() error

Validate returns whether an RPMEntity is valid.

type RackEntity

type RackEntity struct {
	Extra     datastore.PropertyMap `gae:",extra"`
	ID        string                `gae:"$id"`
	Bbnum     int32                 `gae:"bbnum"`
	SwitchIDs []string              `gae:"switch_ids"` // deprecated. Do not use.
	KVMIDs    []string              `gae:"kvm_ids"`    // deprecated. Do not use.
	RPMIDs    []string              `gae:"rpm_ids"`    // deprecated. Do not use.
	Lab       string                `gae:"lab"`        // deprecated
	Zone      string                `gae:"zone"`
	Tags      []string              `gae:"tags"`
	State     string                `gae:"state"`
	Realm     string                `gae:"realm"`
	// ufspb.Rack cannot be directly used as it contains pointer.
	Rack []byte `gae:",noindex"`
	// contains filtered or unexported fields
}

RackEntity is a datastore entity that tracks Rack.

func (*RackEntity) GetProto

func (e *RackEntity) GetProto() (proto.Message, error)

GetProto returns the unmarshaled Rack.

func (*RackEntity) GetRealm

func (e *RackEntity) GetRealm() string

func (*RackEntity) Validate

func (e *RackEntity) Validate() error

Validate returns whether a RackEntity is valid.

type SwitchEntity

type SwitchEntity struct {
	Extra datastore.PropertyMap `gae:",extra"`
	ID    string                `gae:"$id"`
	Lab   string                `gae:"lab"` // deprecated
	Zone  string                `gae:"zone"`
	Rack  string                `gae:"rack"`
	Tags  []string              `gae:"tags"`
	State string                `gae:"state"`
	// ufspb.Switch cannot be directly used as it contains pointer (timestamp).
	Switch []byte `gae:",noindex"`
	// contains filtered or unexported fields
}

SwitchEntity is a datastore entity that tracks switch.

func (*SwitchEntity) GetProto

func (e *SwitchEntity) GetProto() (proto.Message, error)

GetProto returns the unmarshaled switch.

func (*SwitchEntity) Validate

func (e *SwitchEntity) Validate() error

Validate returns whether a SwitchEntity is valid.

Jump to

Keyboard shortcuts

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