Documentation
¶
Overview ¶
Package inventory provides interfaces for managing DataStore entities that correspond to device lab setup environments
Index ¶
- Constants
- func AddMaintenanceConfig(ctx context.Context, name string) (*ufspb.MaintenanceConfig, error)
- func BatchDeleteDeviceLabels(ctx context.Context, ids []string) error
- func BatchDeleteOwnerships(ctx context.Context, ids []string) error
- func BatchDeleteVMs(ctx context.Context, ids []string) error
- func BatchGetDeviceLabels(ctx context.Context, ids []string) ([]*ufspb.DeviceLabels, error)
- func BatchGetMachineLSEDeployments(ctx context.Context, ids []string) ([]*ufspb.MachineLSEDeployment, error)
- func BatchGetMachineLSEs(ctx context.Context, ids []string) ([]*ufspb.MachineLSE, error)
- func BatchGetMaintenanceConfigs(ctx context.Context, names []string) ([]*ufspb.MaintenanceConfig, error)
- func BatchGetVMs(ctx context.Context, ids []string) ([]*ufspb.VM, error)
- func BatchUpdateDeviceLabels(ctx context.Context, labelsList []*ufspb.DeviceLabels) ([]*ufspb.DeviceLabels, error)
- func BatchUpdateMachineLSEs(ctx context.Context, machineLSEs []*ufspb.MachineLSE) ([]*ufspb.MachineLSE, error)
- func BatchUpdateRackLSEs(ctx context.Context, rackLSEs []*ufspb.RackLSE) ([]*ufspb.RackLSE, error)
- func BatchUpdateSchedulingUnits(ctx context.Context, schedulingUnits []*ufspb.SchedulingUnit) ([]*ufspb.SchedulingUnit, error)
- func BatchUpdateVMs(ctx context.Context, vms []*ufspb.VM) ([]*ufspb.VM, error)
- func CreateMachineLSE(ctx context.Context, machineLSE *ufspb.MachineLSE) (*ufspb.MachineLSE, error)
- func CreateRackLSE(ctx context.Context, rackLSE *ufspb.RackLSE) (*ufspb.RackLSE, error)
- func CreateSchedulingUnit(ctx context.Context, su *ufspb.SchedulingUnit) (*ufspb.SchedulingUnit, error)
- func DeleteDeployment(ctx context.Context, id string) error
- func DeleteDeviceLabels(ctx context.Context, id string) error
- func DeleteDeviceLabelsList(ctx context.Context, resourceNames []string) *ufsds.OpResults
- func DeleteMachineLSE(ctx context.Context, id string) error
- func DeleteMachineLSEs(ctx context.Context, resourceNames []string) *ufsds.OpResults
- func DeleteMaintenanceConfig(ctx context.Context, name string) error
- func DeleteRackLSE(ctx context.Context, id string) error
- func DeleteSchedulingUnit(ctx context.Context, name string) error
- func DeleteVM(ctx context.Context, id string) error
- func DeleteVMs(ctx context.Context, resourceNames []string) *ufsds.OpResults
- func GetAllDeviceLabels(ctx context.Context) (*ufsds.OpResults, error)
- func GetAllMachineLSEs(ctx context.Context) (*ufsds.OpResults, error)
- func GetAllMaintenanceConfigs(ctx context.Context) (*ufsds.OpResults, error)
- func GetAllVMs(ctx context.Context) (*ufsds.OpResults, error)
- func GetDeploymentIndexedFieldName(input string) (string, error)
- func GetDeviceLabels(ctx context.Context, id string) (*ufspb.DeviceLabels, error)
- func GetDeviceLabelsIndexedFieldName(input string) (string, error)
- func GetMachineLSE(ctx context.Context, id string) (*ufspb.MachineLSE, error)
- func GetMachineLSEACL(ctx context.Context, id string) (*ufspb.MachineLSE, error)
- func GetMachineLSEDeployment(ctx context.Context, id string) (*ufspb.MachineLSEDeployment, error)
- func GetMachineLSEIndexedFieldName(input string) (string, error)
- func GetMaintenanceConfig(ctx context.Context, name string) (*ufspb.MaintenanceConfig, error)
- func GetOwnershipIndexedFieldName(input string) (string, error)
- func GetRackLSE(ctx context.Context, id string) (*ufspb.RackLSE, error)
- func GetRackLSEIndexedFieldName(input string) (string, error)
- func GetSchedulingUnit(ctx context.Context, name string) (*ufspb.SchedulingUnit, error)
- func GetSchedulingUnitIndexedFieldName(input string) (string, error)
- func GetVM(ctx context.Context, id string) (*ufspb.VM, error)
- func GetVMIndexedFieldName(input string) (string, error)
- func ListAllMachineLSEs(ctx context.Context, keysOnly bool) (res []*ufspb.MachineLSE, err error)
- func ListAllMachineLSEsNameHive(ctx context.Context) (res map[string]string, err error)
- func ListDeviceLabels(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.DeviceLabels, nextPageToken string, err error)
- func ListFreeMachineLSEs(ctx context.Context, requiredSize int32, filterMap map[string][]interface{}, ...) (res []*ufspb.MachineLSE, nextPageToken string, err error)
- func ListMachineLSEDeployments(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.MachineLSEDeployment, nextPageToken string, err error)
- func ListMachineLSEs(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.MachineLSE, nextPageToken string, err error)
- func ListMachineLSEsACL(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.MachineLSE, nextPageToken string, err error)
- func ListMachineLSEsByIdPrefixSearch(ctx context.Context, pageSize int32, pageToken string, prefix string, ...) (res []*ufspb.MachineLSE, nextPageToken string, err error)
- func ListRackLSEs(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.RackLSE, nextPageToken string, err error)
- func ListSchedulingUnits(ctx context.Context, pageSize int32, pageToken string, ...) (res []*ufspb.SchedulingUnit, nextPageToken string, err error)
- func ListVMs(ctx context.Context, pageSize int32, requiredSize int32, pageToken string, ...) (res []*ufspb.VM, nextPageToken string, err error)
- func ListVMsByIdPrefixSearch(ctx context.Context, pageSize int32, requiredSize int32, pageToken string, ...) (res []*ufspb.VM, nextPageToken string, err error)
- func QueryDeviceLabelsByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.DeviceLabels, error)
- func QueryMachineLSEByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.MachineLSE, error)
- func QueryMachineLSEByPropertyNames(ctx context.Context, propertyMap map[string]string, keysOnly bool) ([]*ufspb.MachineLSE, error)
- func QueryRackLSEByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.RackLSE, error)
- func QuerySchedulingUnitByPropertyNames(ctx context.Context, propertyMap map[string]string, keysOnly bool) ([]*ufspb.SchedulingUnit, error)
- func QueryVMByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.VM, error)
- func RangedQueryMachineLSEByPropertyName(ctx context.Context, propertyName string, gtVal, ltVal interface{}, ...) ([]*ufspb.MachineLSE, error)
- func RangedQueryMachineLSEByPropertyNames(ctx context.Context, propertyMap map[string][]interface{}, keysOnly bool) ([]*ufspb.MachineLSE, error)
- func UpdateMachineLSE(ctx context.Context, machineLSE *ufspb.MachineLSE) (*ufspb.MachineLSE, error)
- func UpdateMachineLSEDeployments(ctx context.Context, dis []*ufspb.MachineLSEDeployment) ([]*ufspb.MachineLSEDeployment, error)
- func UpdateMachineLSEOwnership(ctx context.Context, id string, ownership *ufspb.OwnershipData) (*ufspb.MachineLSE, error)
- func UpdateMaintenanceConfigs(ctx context.Context, configs []*ufspb.MaintenanceConfig) ([]*ufspb.MaintenanceConfig, error)
- func UpdateRackLSE(ctx context.Context, rackLSE *ufspb.RackLSE) (*ufspb.RackLSE, error)
- func UpdateVMOwnership(ctx context.Context, id string, ownership *ufspb.OwnershipData) (*ufspb.VM, error)
- type DeviceLabelsEntity
- type MachineLSEDeploymentEntity
- type MachineLSEEntity
- type MaintenanceConfigEntity
- type OwnershipDataEntity
- func GetOwnershipData(ctx context.Context, name string) (*OwnershipDataEntity, error)
- func ListHostsByIdPrefixSearch(ctx context.Context, pageSize int32, pageToken string, prefix string, ...) (res []OwnershipDataEntity, nextPageToken string, err error)
- func ListOwnerships(ctx context.Context, pageSize int32, pageToken string, ...) (res []OwnershipDataEntity, nextPageToken string, err error)
- func PutOwnershipData(ctx context.Context, ownership *ufspb.OwnershipData, name string, ...) (*OwnershipDataEntity, error)
- type RackLSEEntity
- type SchedulingUnitEntity
- type VMEntity
Constants ¶
const AssetTypeMachine string = "Machine"
AssetTypeMachine is the Machine asset type.
const AssetTypeMachineLSE string = "MachineLSE"
AssetTypeMachineLSE is the MachineLSE asset type
const AssetTypeVM string = "VM"
AssetTypeVM is the VM asset type.
const CommitSh string = "CommitSh"
CommitSh is the commit at which we need to pull the configs.
const DeviceLabelsKind string = "DeviceLabels"
DeviceLabelsKind is the datastore entity kind for labels.
const MachineLSEDeploymentKind string = "MachineLSEDeployment"
MachineLSEDeploymentKind is the datastore entity kind for host deployment info.
const MachineLSEKind string = "MachineLSE"
MachineLSEKind is the datastore entity kind MachineLSE.
const MaintenanceConfigKind string = "MaintenanceConfig"
MaintenanceConfigKind is the datastore entity kind MaintenanceConfig.
const OwnershipDataKind string = "Ownership"
OwnershipDataKind is the datastore entity kind OwnershipData.
const RackLSEKind string = "RackLSE"
RackLSEKind is the datastore entity kind RackLSE.
const SchedulingUnitKind string = "SchedulingUnit"
SchedulingUnitKind is the datastore entity kind for SchedulingUnit.
const VMKind string = "ChromeVM"
VMKind is the datastore entity kind for vm.
Variables ¶
This section is empty.
Functions ¶
func AddMaintenanceConfig ¶
func BatchDeleteDeviceLabels ¶
BatchDeleteDeviceLabels deletes labels 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 BatchDeleteOwnerships ¶
BatchDeleteOwnerships deletes a batch of entities with the given ids
func BatchDeleteVMs ¶
BatchDeleteVMs deletes vms 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 BatchGetDeviceLabels ¶
BatchGetDeviceLabels returns a batch of labels from datastore.
func BatchGetMachineLSEDeployments ¶
func BatchGetMachineLSEDeployments(ctx context.Context, ids []string) ([]*ufspb.MachineLSEDeployment, error)
BatchGetMachineLSEDeployments returns a batch of deployment records from datastore.
func BatchGetMachineLSEs ¶
BatchGetMachineLSEs returns a batch of machine lses from datastore.
func BatchGetMaintenanceConfigs ¶
func BatchGetMaintenanceConfigs(ctx context.Context, names []string) ([]*ufspb.MaintenanceConfig, error)
BatchGetMaintenanceConfigs returns a batch of maintenance configurations from datastore.
func BatchGetVMs ¶
BatchGetVMs returns a batch of vms from datastore.
func BatchUpdateDeviceLabels ¶
func BatchUpdateDeviceLabels(ctx context.Context, labelsList []*ufspb.DeviceLabels) ([]*ufspb.DeviceLabels, error)
BatchUpdateDeviceLabels updates labels 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 BatchUpdateMachineLSEs ¶
func BatchUpdateMachineLSEs(ctx context.Context, machineLSEs []*ufspb.MachineLSE) ([]*ufspb.MachineLSE, error)
BatchUpdateMachineLSEs updates machineLSEs 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 BatchUpdateRackLSEs ¶
BatchUpdateRackLSEs updates rackLSEs 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 BatchUpdateSchedulingUnits ¶
func BatchUpdateSchedulingUnits(ctx context.Context, schedulingUnits []*ufspb.SchedulingUnit) ([]*ufspb.SchedulingUnit, error)
BatchUpdateSchedulingUnits updates SchedulingUnits 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 BatchUpdateVMs ¶
BatchUpdateVMs updates vms 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 CreateMachineLSE ¶
func CreateMachineLSE(ctx context.Context, machineLSE *ufspb.MachineLSE) (*ufspb.MachineLSE, error)
CreateMachineLSE creates a new machineLSE in datastore.
func CreateRackLSE ¶
CreateRackLSE creates a new rackLSE in datastore.
func CreateSchedulingUnit ¶
func CreateSchedulingUnit(ctx context.Context, su *ufspb.SchedulingUnit) (*ufspb.SchedulingUnit, error)
CreateSchedulingUnit creates a new SchedulingUnit in datastore.
func DeleteDeployment ¶
DeleteDeployment deletes a deployment record
func DeleteDeviceLabels ¶
DeleteDeviceLabels deletes the labels in datastore
func DeleteDeviceLabelsList ¶
DeleteDeviceLabelsList deletes a batch of labels
Can be used in a transaction
func DeleteMachineLSE ¶
DeleteMachineLSE deletes the machineLSE in datastore
func DeleteMachineLSEs ¶
DeleteMachineLSEs deletes a batch of machine LSEs
func DeleteMaintenanceConfig ¶
DeleteMaintenanceConfig removes a maintenance configuration using its unique name.
func DeleteRackLSE ¶
DeleteRackLSE deletes the rackLSE in datastore
func DeleteSchedulingUnit ¶
DeleteSchedulingUnit deletes the SchedulingUnit in datastore.
func GetAllDeviceLabels ¶
GetAllDeviceLabels returns all labels in datastore.
func GetAllMachineLSEs ¶
GetAllMachineLSEs returns all machine lses in datastore.
func GetAllMaintenanceConfigs ¶
GetAllMaintenanceConfigs returns all maintenance configurations in datastore.
func GetDeploymentIndexedFieldName ¶
GetDeploymentIndexedFieldName returns the index name
func GetDeviceLabels ¶
GetDeviceLabels returns labels for the given id from datastore.
func GetDeviceLabelsIndexedFieldName ¶
GetDeviceLabelsIndexedFieldName returns the index name
func GetMachineLSE ¶
GetMachineLSE returns machine for the given id from datastore.
func GetMachineLSEACL ¶
GetMachineLSEACL returns the machineLSE for the requested id if the user has permissions to do so.
func GetMachineLSEDeployment ¶
GetMachineLSEDeployment returns the deployment record for a given serial number
func GetMachineLSEIndexedFieldName ¶
GetMachineLSEIndexedFieldName returns the index name
func GetMaintenanceConfig ¶
GetMaintenanceConfig retrieves a maintenance configuration from the datastore by its name if it exists.
func GetOwnershipIndexedFieldName ¶
GetOwnershipIndexedFieldName returns the index name
func GetRackLSE ¶
GetRackLSE returns rack for the given id from datastore.
func GetRackLSEIndexedFieldName ¶
GetRackLSEIndexedFieldName returns the index name
func GetSchedulingUnit ¶
GetSchedulingUnit returns SchedulingUnit for the given name from datastore.
func GetSchedulingUnitIndexedFieldName ¶
GetSchedulingUnitIndexedFieldName returns the index name
func GetVMIndexedFieldName ¶
GetVMIndexedFieldName returns the index name
func ListAllMachineLSEs ¶
ListAllMachineLSEs returns all machine lses in datastore.
func ListAllMachineLSEsNameHive ¶
ListAllMachineLSEsNameHive return all machine lses name and hive in datastore.
func ListDeviceLabels ¶
func ListDeviceLabels(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.DeviceLabels, nextPageToken string, err error)
ListDeviceLabels lists the labels
Does a query over labels entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.
func ListFreeMachineLSEs ¶
func ListFreeMachineLSEs(ctx context.Context, requiredSize int32, filterMap map[string][]interface{}, capacityMap map[string]int) (res []*ufspb.MachineLSE, nextPageToken string, err error)
ListFreeMachineLSEs lists the machine lses with vm capacity
func ListMachineLSEDeployments ¶
func ListMachineLSEDeployments(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.MachineLSEDeployment, nextPageToken string, err error)
ListMachineLSEDeployments lists the deployment records
Does a query over MachineLSEDeploymentEntity. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.
func ListMachineLSEs ¶
func ListMachineLSEs(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.MachineLSE, nextPageToken string, err error)
ListMachineLSEs lists the machine lses Does a query over MachineLSE entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.
func ListMachineLSEsACL ¶
func ListMachineLSEsACL(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.MachineLSE, nextPageToken string, err error)
ListMachineLSEsACL lists the machine lses that user has access to Does a query over MachineLSE entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.
func ListMachineLSEsByIdPrefixSearch ¶
func ListMachineLSEsByIdPrefixSearch(ctx context.Context, pageSize int32, pageToken string, prefix string, keysOnly bool) (res []*ufspb.MachineLSE, nextPageToken string, err error)
ListMachineLSEsByIdPrefixSearch lists the machineLSEs Does a query over MachineLSE entities using Name/ID prefix. Returns up to pageSize entities, plus non-nil cursor (if there are more results). PageSize must be positive.
func ListRackLSEs ¶
func ListRackLSEs(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.RackLSE, nextPageToken string, err error)
ListRackLSEs lists the racks
Does a query over RackLSE entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.
func ListSchedulingUnits ¶
func ListSchedulingUnits(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.SchedulingUnit, nextPageToken string, err error)
ListSchedulingUnits lists the SchedulingUnits.
Does a query over SchedulingUnit entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.
func ListVMs ¶
func ListVMs(ctx context.Context, pageSize int32, requiredSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool, validFunc func(*ufspb.VM) bool) (res []*ufspb.VM, nextPageToken string, err error)
ListVMs lists the vms
Does a query over vm entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.
func ListVMsByIdPrefixSearch ¶
func ListVMsByIdPrefixSearch(ctx context.Context, pageSize int32, requiredSize int32, pageToken string, prefix string, keysOnly bool, validFunc func(*ufspb.VM) bool) (res []*ufspb.VM, nextPageToken string, err error)
ListVMsByIdPrefixSearch lists the VMs
Does a query over VM entities using Name/ID prefix. Returns up to pageSize entities, plus non-nil cursor (if there are more results). PageSize must be positive.
func QueryDeviceLabelsByPropertyName ¶
func QueryDeviceLabelsByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.DeviceLabels, error)
QueryDeviceLabelsByPropertyName queries DeviceLabels Entity in the datastore If keysOnly is true, then only key field is populated in returned machinelses
func QueryMachineLSEByPropertyName ¶
func QueryMachineLSEByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.MachineLSE, error)
QueryMachineLSEByPropertyName queries MachineLSE Entity in the datastore If keysOnly is true, then only key field is populated in returned machinelses
func QueryMachineLSEByPropertyNames ¶
func QueryMachineLSEByPropertyNames(ctx context.Context, propertyMap map[string]string, keysOnly bool) ([]*ufspb.MachineLSE, error)
QueryMachineLSEByPropertyNames queries MachineLSE Entity in the datastore If keysOnly is true, then only key field is populated in returned machinelses
func QueryRackLSEByPropertyName ¶
func QueryRackLSEByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.RackLSE, error)
QueryRackLSEByPropertyName queries RackLSE Entity in the datastore
If keysOnly is true, then only key field is populated in returned racklses
func QuerySchedulingUnitByPropertyNames ¶
func QuerySchedulingUnitByPropertyNames(ctx context.Context, propertyMap map[string]string, keysOnly bool) ([]*ufspb.SchedulingUnit, error)
QuerySchedulingUnitByPropertyNames queries SchedulingUnit Entity in the datastore If keysOnly is true, then only key field is populated in returned SchedulingUnits
func QueryVMByPropertyName ¶
func QueryVMByPropertyName(ctx context.Context, propertyName, id string, keysOnly bool) ([]*ufspb.VM, error)
QueryVMByPropertyName queries VM Entity in the datastore If keysOnly is true, then only key field is populated in returned machinelses
func RangedQueryMachineLSEByPropertyName ¶
func RangedQueryMachineLSEByPropertyName(ctx context.Context, propertyName string, gtVal, ltVal interface{}, keysOnly bool) ([]*ufspb.MachineLSE, error)
RangedQueryMachineLSEByPropertyName queries MachineLSE entity in the datastore. The query run here is given by `SELECT * FROM MachineLSE WHERE propertyName >= gtVal AND propertyName <= ltVal`
func UpdateMachineLSE ¶
func UpdateMachineLSE(ctx context.Context, machineLSE *ufspb.MachineLSE) (*ufspb.MachineLSE, error)
UpdateMachineLSE updates machineLSE in datastore.
func UpdateMachineLSEDeployments ¶
func UpdateMachineLSEDeployments(ctx context.Context, dis []*ufspb.MachineLSEDeployment) ([]*ufspb.MachineLSEDeployment, error)
UpdateMachineLSEDeployments updates the deployment infos for a batch of hosts in datastore.
func UpdateMachineLSEOwnership ¶
func UpdateMachineLSEOwnership(ctx context.Context, id string, ownership *ufspb.OwnershipData) (*ufspb.MachineLSE, error)
UpdateMachineLSEOwnership updates machineLSE ownership in datastore.
func UpdateMaintenanceConfigs ¶
func UpdateMaintenanceConfigs(ctx context.Context, configs []*ufspb.MaintenanceConfig) ([]*ufspb.MaintenanceConfig, error)
UpdateMaintenanceConfigs updates the Maintenance Configuration in datastore.
func UpdateRackLSE ¶
UpdateRackLSE updates rackLSE in datastore.
func UpdateVMOwnership ¶
func UpdateVMOwnership(ctx context.Context, id string, ownership *ufspb.OwnershipData) (*ufspb.VM, error)
UpdateVMOwnership updates VM ownership in datastore.
Types ¶
type DeviceLabelsEntity ¶
type DeviceLabelsEntity struct { Extra datastore.PropertyMap `gae:",extra"` ID string `gae:"$id"` ResourceType string `gae:"resource_type"` // ufspb.DeviceLabels cannot be directly used as it contains pointer. DeviceLabels []byte `gae:",noindex"` // contains filtered or unexported fields }
DeviceLabelsEntity is a datastore entity that tracks DeviceLabels.
func (*DeviceLabelsEntity) GetProto ¶
func (e *DeviceLabelsEntity) GetProto() (proto.Message, error)
GetProto returns the unmarshaled DeviceLabels.
func (*DeviceLabelsEntity) Validate ¶
func (e *DeviceLabelsEntity) Validate() error
Validate returns whether a DeviceLabelsEntity is valid
type MachineLSEDeploymentEntity ¶
type MachineLSEDeploymentEntity struct { Extra datastore.PropertyMap `gae:",extra"` ID string `gae:"$id"` Hostname string `gae:"hostname"` DeploymentIdentifier string `gae:"deployment_identifier"` DeploymentEnv string `gae:"deployment_env"` // Follow others entities, store ufspb.MachineLSEDeployment bytes. DeploymentInfo []byte `gae:",noindex"` // contains filtered or unexported fields }
MachineLSEDeploymentEntity is a datastore entity that tracks the deployment info for a host.
func (*MachineLSEDeploymentEntity) GetProto ¶
func (e *MachineLSEDeploymentEntity) GetProto() (proto.Message, error)
GetProto returns the unmarshaled MachineLSEDeploymentEntity.
func (*MachineLSEDeploymentEntity) Validate ¶
func (e *MachineLSEDeploymentEntity) Validate() error
Validate returns whether a MachineLSEDeploymentEntity is valid
type MachineLSEEntity ¶
type MachineLSEEntity struct { Extra datastore.PropertyMap `gae:",extra"` ID string `gae:"$id"` MachineIDs []string `gae:"machine_ids"` MachineLSEProtoTypeID string `gae:"machinelse_prototype_id"` SwitchID string `gae:"switch_id"` RPMID string `gae:"rpm_id"` RPMPort string `gae:"rpm_port"` RPMType string `gae:"rpm_type"` VlanID string `gae:"vlan_id"` ServoID string `gae:"servo_id"` ServoType string `gae:"servo_type"` Rack string `gae:"rack"` Lab string `gae:"lab"` // deprecated Zone string `gae:"zone"` Manufacturer string `gae:"manufacturer"` Tags []string `gae:"tags"` State string `gae:"state"` OS []string `gae:"os"` VirtualDatacenter string `gae:"virtualdatacenter"` Nic string `gae:"nic"` Pools []string `gae:"pools"` AssociatedHostname string `gae:"associated_hostname"` AssociatedHostPort string `gae:"associated_host_port"` 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 LogicalZone string `gae:"logical_zone"` Realm string `gae:"realm"` Hive string `gae:"hive"` // ufspb.MachineLSE cannot be directly used as it contains pointer. MachineLSE []byte `gae:",noindex"` // contains filtered or unexported fields }
MachineLSEEntity is a datastore entity that tracks MachineLSE.
func (*MachineLSEEntity) GetProto ¶
func (e *MachineLSEEntity) GetProto() (proto.Message, error)
GetProto returns the unmarshaled MachineLSE.
func (*MachineLSEEntity) GetRealm ¶
func (e *MachineLSEEntity) GetRealm() string
GetRealm returns the realm for the MachineLSE.
func (*MachineLSEEntity) Validate ¶
func (e *MachineLSEEntity) Validate() error
Validate returns whether a MachineLSEEntity is valid
type MaintenanceConfigEntity ¶
type MaintenanceConfigEntity struct { Extra datastore.PropertyMap `gae:",extra"` Name string `gae:"$id"` MaintenanceConfig []byte `gae:",noindex"` // contains filtered or unexported fields }
func (*MaintenanceConfigEntity) GetProto ¶
func (e *MaintenanceConfigEntity) GetProto() (proto.Message, error)
GetProto returns the unmarshalled MaintenanceConfig
func (*MaintenanceConfigEntity) Validate ¶
func (e *MaintenanceConfigEntity) Validate() error
Validate returns whether a MaintenanceConfigEntity is valid
type OwnershipDataEntity ¶
type OwnershipDataEntity struct { Extra datastore.PropertyMap `gae:",extra"` Name string `gae:"$id"` AssetType string `gae:"AssetType"` OwnershipData []byte `gae:",noindex"` // contains filtered or unexported fields }
OwnershipDataEntity is a datastore entity that tracks a OwnershipData.
func GetOwnershipData ¶
func GetOwnershipData(ctx context.Context, name string) (*OwnershipDataEntity, error)
GetOwnershipData returns OwnershipData for the given bot name from datastore.
func ListHostsByIdPrefixSearch ¶
func ListHostsByIdPrefixSearch(ctx context.Context, pageSize int32, pageToken string, prefix string, keysOnly bool) (res []OwnershipDataEntity, nextPageToken string, err error)
ListHostsByIdPrefixSearch lists the hosts
Does a query over OwnershipData entities using ID prefix. Returns up to pageSize entities, plus non-nil cursor ( if there are more results). PageSize must be positive.
func ListOwnerships ¶
func ListOwnerships(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []OwnershipDataEntity, nextPageToken string, err error)
ListOwnerships lists the owmerships Does a query over Ownership entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.
func PutOwnershipData ¶
func PutOwnershipData(ctx context.Context, ownership *ufspb.OwnershipData, name string, assetType string) (*OwnershipDataEntity, error)
PutOwnershipData adds a bot name and its corresponding ownership in the datastore.
func (*OwnershipDataEntity) GetProto ¶
func (e *OwnershipDataEntity) GetProto() (proto.Message, error)
GetProto returns the unmarshaled OwnershipData.
func (*OwnershipDataEntity) Validate ¶
func (e *OwnershipDataEntity) Validate() error
Validate returns whether an OwnershipDataEntity is valid.
type RackLSEEntity ¶
type RackLSEEntity struct { Extra datastore.PropertyMap `gae:",extra"` ID string `gae:"$id"` RackIDs []string `gae:"rack_ids"` RackLSEProtoTypeID string `gae:"racklse_prototype_id"` KVMIDs []string `gae:"kvm_ids"` RPMIDs []string `gae:"rpm_ids"` SwitchIDs []string `gae:"switch_ids"` // ufspb.RackLSE cannot be directly used as it contains pointer. RackLSE []byte `gae:",noindex"` // contains filtered or unexported fields }
RackLSEEntity is a datastore entity that tracks RackLSE.
func (*RackLSEEntity) GetProto ¶
func (e *RackLSEEntity) GetProto() (proto.Message, error)
GetProto returns the unmarshaled RackLSE.
func (*RackLSEEntity) Validate ¶
func (e *RackLSEEntity) Validate() error
Validate returns whether a RackLSEEntity is valid
type SchedulingUnitEntity ¶
type SchedulingUnitEntity struct { Extra datastore.PropertyMap `gae:",extra"` ID string `gae:"$id"` Type string `gae:"type"` Pools []string `gae:"pools"` MachineLSEs []string `gae:"machinelses"` Tags []string `gae:"tags"` // ufspb.SchedulingUnit cannot be directly used as it contains pointer. SchedulingUnit []byte `gae:",noindex"` // contains filtered or unexported fields }
SchedulingUnitEntity is a datastore entity that tracks a SchedulingUnit.
func (*SchedulingUnitEntity) GetProto ¶
func (e *SchedulingUnitEntity) GetProto() (proto.Message, error)
GetProto returns the unmarshaled SchedulingUnit.
func (*SchedulingUnitEntity) Validate ¶
func (e *SchedulingUnitEntity) Validate() error
Validate returns whether a SchedulingUnitEntity is valid
type VMEntity ¶
type VMEntity struct { Extra datastore.PropertyMap `gae:",extra"` ID string `gae:"$id"` OSVersion string `gae:"os_version"` Vlan string `gae:"vlan_id"` HostID string `gae:"host_id"` State string `gae:"state"` Lab string `gae:"lab"` // deprecated Zone string `gae:"zone"` Tags []string `gae:"tags"` OS []string `gae:"os"` MacAddress string `gae:"mac_address"` CpuCores int32 `gae:"cpu_cores"` Memory int64 `gae:"memory"` Storage int64 `gae:"storage"` 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 // Follow others entities, store ufspb.VM bytes. VM []byte `gae:",noindex"` // contains filtered or unexported fields }
VMEntity is a datastore entity that tracks VM.