Documentation
¶
Overview ¶
Package registration provides interfaces for managing DataStore entities that correspond to physical devices
Index ¶
- Constants
- func BatchDeleteKVMs(ctx context.Context, ids []string) error
- func BatchDeleteNics(ctx context.Context, ids []string) error
- func BatchDeleteRPMs(ctx context.Context, ids []string) error
- func BatchDeleteSwitches(ctx context.Context, ids []string) error
- func BatchGetDracs(ctx context.Context, ids []string) ([]*ufspb.Drac, error)
- func BatchGetKVM(ctx context.Context, ids []string) ([]*ufspb.KVM, error)
- func BatchGetMachinesACL(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 BatchGetRacks(ctx context.Context, ids []string) ([]*ufspb.Rack, error)
- func BatchGetRacksACL(ctx context.Context, ids []string) ([]*ufspb.Rack, error)
- func BatchGetSwitches(ctx context.Context, ids []string) ([]*ufspb.Switch, error)
- func BatchUpdateAssets(ctx context.Context, assets []*ufspb.Asset) ([]*ufspb.Asset, error)
- func BatchUpdateDracs(ctx context.Context, dracs []*ufspb.Drac) ([]*ufspb.Drac, error)
- func BatchUpdateKVMs(ctx context.Context, kvms []*ufspb.KVM) ([]*ufspb.KVM, error)
- func BatchUpdateMachines(ctx context.Context, machines []*ufspb.Machine) ([]*ufspb.Machine, error)
- func BatchUpdateNics(ctx context.Context, nics []*ufspb.Nic) ([]*ufspb.Nic, error)
- func BatchUpdateRPMs(ctx context.Context, rpms []*ufspb.RPM) ([]*ufspb.RPM, error)
- func BatchUpdateRacks(ctx context.Context, racks []*ufspb.Rack) ([]*ufspb.Rack, error)
- func BatchUpdateSwitches(ctx context.Context, switches []*ufspb.Switch) ([]*ufspb.Switch, error)
- func CreateAsset(ctx context.Context, asset *ufspb.Asset) (*ufspb.Asset, error)
- func CreateDrac(ctx context.Context, drac *ufspb.Drac) (*ufspb.Drac, error)
- func CreateKVM(ctx context.Context, KVM *ufspb.KVM) (*ufspb.KVM, error)
- func CreateMachine(ctx context.Context, machine *ufspb.Machine) (*ufspb.Machine, error)
- func CreateNic(ctx context.Context, nic *ufspb.Nic) (*ufspb.Nic, error)
- func CreateRPM(ctx context.Context, RPM *ufspb.RPM) (*ufspb.RPM, error)
- func CreateRack(ctx context.Context, rack *ufspb.Rack) (*ufspb.Rack, error)
- func CreateSwitch(ctx context.Context, s *ufspb.Switch) (*ufspb.Switch, error)
- func DeleteAsset(ctx context.Context, id string) error
- func DeleteDefaultWifi(ctx context.Context, name string) error
- func DeleteDrac(ctx context.Context, id string) error
- func DeleteDracs(ctx context.Context, resourceNames []string) *ufsds.OpResults
- func DeleteKVM(ctx context.Context, id string) error
- func DeleteKVMs(ctx context.Context, resourceNames []string) *ufsds.OpResults
- func DeleteMachine(ctx context.Context, id string) error
- func DeleteMachines(ctx context.Context, resourceNames []string) *ufsds.OpResults
- func DeleteNic(ctx context.Context, id string) error
- func DeleteNics(ctx context.Context, resourceNames []string) *ufsds.OpResults
- func DeleteRPM(ctx context.Context, id string) error
- func DeleteRack(ctx context.Context, id string) error
- func DeleteRacks(ctx context.Context, resourceNames []string) *ufsds.OpResults
- func DeleteSwitch(ctx context.Context, id string) error
- func DeleteSwitches(ctx context.Context, resourceNames []string) *ufsds.OpResults
- func GetAllAssets(ctx context.Context) ([]*ufspb.Asset, error)
- func GetAllDracs(ctx context.Context) (*ufsds.OpResults, error)
- func GetAllKVMs(ctx context.Context) (*ufsds.OpResults, error)
- func GetAllNics(ctx context.Context) (*ufsds.OpResults, error)
- func GetAllRacks(ctx context.Context) (*ufsds.OpResults, error)
- func GetAllSwitches(ctx context.Context) (*ufsds.OpResults, error)
- func GetAsset(ctx context.Context, name string) (*ufspb.Asset, error)
- func GetAssetACL(ctx context.Context, id string) (*ufspb.Asset, error)
- func GetAssetIndexedFieldName(input string) (string, error)
- func GetDefaultWifi(ctx context.Context, name string) (*ufspb.DefaultWifi, error)
- func GetDrac(ctx context.Context, id string) (*ufspb.Drac, error)
- func GetDracIndexedFieldName(input string) (string, error)
- func GetKVM(ctx context.Context, id string) (*ufspb.KVM, error)
- func GetKVMIndexedFieldName(input string) (string, error)
- func GetMachine(ctx context.Context, id string) (*ufspb.Machine, error)
- func GetMachineACL(ctx context.Context, id string) (*ufspb.Machine, error)
- func GetMachineIndexedFieldName(input string) (string, error)
- func GetNic(ctx context.Context, id string) (*ufspb.Nic, error)
- func GetNicIndexedFieldName(input string) (string, error)
- func GetRPM(ctx context.Context, id string) (*ufspb.RPM, error)
- func GetRPMIndexedFieldName(input string) (string, error)
- func GetRack(ctx context.Context, id string) (*ufspb.Rack, error)
- func GetRackACL(ctx context.Context, id string) (*ufspb.Rack, error)
- func GetRackIndexedFieldName(input string) (string, error)
- func GetSwitch(ctx context.Context, id string) (*ufspb.Switch, error)
- func GetSwitchIndexedFieldName(input string) (string, error)
- func ListAssets(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.Asset, nextPageToken string, err error)
- func ListAssetsACL(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.Asset, nextPageToken string, err error)
- func ListDracs(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.Drac, nextPageToken string, err error)
- func ListKVMs(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.KVM, nextPageToken string, err error)
- func ListMachines(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.Machine, nextPageToken string, err error)
- func ListMachinesACL(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.Machine, nextPageToken string, err error)
- func ListMachinesByIdPrefixSearch(ctx context.Context, pageSize int32, pageToken string, prefix string, ...) (res []*ufspb.Machine, nextPageToken string, err error)
- func ListNics(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.Nic, nextPageToken string, err error)
- func ListRPMs(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.RPM, nextPageToken string, err error)
- func ListRacks(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.Rack, nextPageToken string, err error)
- func ListRacksACL(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.Rack, nextPageToken string, err error)
- func ListSwitches(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.Switch, nextPageToken string, err error)
- func NonAtomicBatchCreateDefaultWifis(ctx context.Context, wifis []*ufspb.DefaultWifi) ([]*ufspb.DefaultWifi, error)
- func NonAtomicBatchUpdateDefaultWifis(ctx context.Context, wifis []*ufspb.DefaultWifi) ([]*ufspb.DefaultWifi, error)
- func QueryAssetByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.Asset, error)
- func QueryDracByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.Drac, error)
- func QueryKVMByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.KVM, error)
- func QueryMachineByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.Machine, error)
- func QueryNicByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.Nic, error)
- func QueryRPMByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.RPM, error)
- func QueryRackByPropertyName(ctx context.Context, propertyName string, id interface{}, keysOnly bool) ([]*ufspb.Rack, error)
- func QuerySwitchByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.Switch, error)
- func UpdateAsset(ctx context.Context, asset *ufspb.Asset) (*ufspb.Asset, error)
- func UpdateDrac(ctx context.Context, drac *ufspb.Drac) (*ufspb.Drac, error)
- func UpdateKVM(ctx context.Context, KVM *ufspb.KVM) (*ufspb.KVM, error)
- func UpdateMachine(ctx context.Context, machine *ufspb.Machine) (*ufspb.Machine, error)
- func UpdateMachineOwnership(ctx context.Context, id string, ownership *ufspb.OwnershipData) (*ufspb.Machine, error)
- func UpdateNic(ctx context.Context, nic *ufspb.Nic) (*ufspb.Nic, error)
- func UpdateRPM(ctx context.Context, RPM *ufspb.RPM) (*ufspb.RPM, error)
- func UpdateRack(ctx context.Context, rack *ufspb.Rack) (*ufspb.Rack, error)
- func UpdateSwitch(ctx context.Context, s *ufspb.Switch) (*ufspb.Switch, error)
- type AssetEntity
- type DefaultWifiEntry
- type DracEntity
- type KVMEntity
- type MachineEntity
- type NicEntity
- type RPMEntity
- type RackEntity
- type SwitchEntity
Constants ¶
const AssetKind string = "Asset"
AssetKind is a datastore entity identifier for Asset
const DefaultWifiKind string = "DefaultWifi"
DefaultWifiKind is the datastore entity kind DefaultWifi.
const DracKind string = "Drac"
DracKind is the datastore entity kind Drac.
const KVMKind string = "KVM"
KVMKind is the datastore entity kind KVM.
const MachineKind string = "Machine"
MachineKind is the datastore entity kind Machine.
const NicKind string = "Nic"
NicKind is the datastore entity kind Nic.
const RPMKind string = "RPM"
RPMKind is the datastore entity kind RPM.
const RackKind string = "Rack"
RackKind is the datastore entity kind Rack.
const SwitchKind string = "Switch"
SwitchKind is the datastore entity kind Switch.
Variables ¶
This section is empty.
Functions ¶
func BatchDeleteKVMs ¶
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 ¶
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 ¶
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 ¶
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 ¶
BatchGetDracs returns a batch of dracs from datastore.
func BatchGetKVM ¶
BatchGetKVM returns a batch of KVMs from datastore.
func BatchGetMachinesACL ¶
BatchGetMachinesACL routes the request to either the ACLed or unACLed method depending on the rollout status.
func BatchGetNics ¶
BatchGetNics returns a batch of nics from datastore.
func BatchGetRPMs ¶
BatchGetRPMs returns a batch of rpms from datastore.
func BatchGetRacks ¶
BatchGetRacks returns a batch of racks from datastore.
func BatchGetRacksACL ¶
BatchGetRacksACL returns a batch of racks after potentially checking for ACLs in the relevant realms.
func BatchGetSwitches ¶
BatchGetSwitches returns a batch of switches from datastore.
func BatchUpdateAssets ¶
BatchUpdateAssets updates the assets to the datastore
func BatchUpdateDracs ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
CreateAsset creates an asset record in the datastore using the given asset proto.
func CreateDrac ¶
CreateDrac creates a new drac in datastore.
func CreateMachine ¶
CreateMachine creates a new machine in datastore.
func CreateRack ¶
CreateRack creates a new rack in datastore.
func CreateSwitch ¶
CreateSwitch creates a new switch in datastore.
func DeleteAsset ¶
DeleteAsset deletes the asset corresponding to id from datastore.
func DeleteDefaultWifi ¶
DeleteDefaultWifi deletes the DefaultWifi in datastore.
func DeleteDrac ¶
DeleteDrac deletes the drac in datastore
func DeleteDracs ¶
DeleteDracs deletes a batch of dracs
func DeleteKVMs ¶
DeleteKVMs deletes a batch of kvms
func DeleteMachine ¶
DeleteMachine deletes the machine in datastore
func DeleteMachines ¶
DeleteMachines deletes a batch of machines
func DeleteNics ¶
DeleteNics deletes a batch of nics
func DeleteRack ¶
DeleteRack deletes the rack in datastore
func DeleteRacks ¶
DeleteRacks deletes a batch of racks
func DeleteSwitch ¶
DeleteSwitch deletes the switch in datastore
func DeleteSwitches ¶
DeleteSwitches deletes a batch of switches
func GetAllAssets ¶
GetAllAssets returns all assets currently in the datastore.
func GetAllDracs ¶
GetAllDracs returns all dracs in datastore.
func GetAllKVMs ¶
GetAllKVMs returns all kvms in datastore.
func GetAllNics ¶
GetAllNics returns all nics in datastore.
func GetAllRacks ¶
GetAllRacks returns all racks in datastore.
func GetAllSwitches ¶
GetAllSwitches returns all switches in datastore.
func GetAssetACL ¶
GetAssetACL routes the request to either the ACLed or unACLed method depending on the rollout status.
func GetAssetIndexedFieldName ¶
GetAssetIndexedFieldName returns the index name
func GetDefaultWifi ¶
GetDefaultWifi returns the specified default wifi.
func GetDracIndexedFieldName ¶
GetDracIndexedFieldName returns the index name
func GetKVMIndexedFieldName ¶
GetKVMIndexedFieldName returns the index name
func GetMachine ¶
GetMachine returns machine for the given id from datastore.
func GetMachineACL ¶
GetMachineACL routes the request to either the ACLed or unACLed method depending on the rollout status.
func GetMachineIndexedFieldName ¶
GetMachineIndexedFieldName returns the index name
func GetNicIndexedFieldName ¶
GetNicIndexedFieldName returns the index name
func GetRPMIndexedFieldName ¶
GetRPMIndexedFieldName returns the index name
func GetRackACL ¶
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 ¶
GetRackIndexedFieldName returns the index name
func GetSwitchIndexedFieldName ¶
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 ¶
UpdateAsset updates the asset to the given asset proto.
func UpdateDrac ¶
UpdateDrac updates drac in datastore.
func UpdateMachine ¶
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 UpdateRack ¶
UpdateRack updates rack 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.
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.
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.
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.