Documentation ¶
Index ¶
- Constants
- func BatchDeleteVMs(ctx context.Context, ids []string) error
- func BatchGetMachineLSEDeployments(ctx context.Context, ids []string) ([]*ufspb.MachineLSEDeployment, error)
- func BatchGetMachineLSEs(ctx context.Context, ids []string) ([]*ufspb.MachineLSE, error)
- func BatchGetVMs(ctx context.Context, ids []string) ([]*ufspb.VM, 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 DeleteMachineLSE(ctx context.Context, id string) error
- func DeleteMachineLSEs(ctx context.Context, resourceNames []string) *ufsds.OpResults
- 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 GetAllMachineLSEs(ctx context.Context) (*ufsds.OpResults, error)
- func GetAllVMs(ctx context.Context) (*ufsds.OpResults, error)
- func GetDeploymentIndexedFieldName(input string) (string, error)
- func GetMachineLSE(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 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 ImportMachineLSEs(ctx context.Context, lses []*ufspb.MachineLSE) (*ufsds.OpResults, error)
- func ImportRackLSEs(ctx context.Context, lses []*ufspb.RackLSE) (*ufsds.OpResults, error)
- func ImportVMs(ctx context.Context, vms []*ufspb.VM) (*ufsds.OpResults, error)
- func ListAllMachineLSEs(ctx context.Context, keysOnly bool) (res []*ufspb.MachineLSE, 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 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 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 UpdateRackLSE(ctx context.Context, rackLSE *ufspb.RackLSE) (*ufspb.RackLSE, error)
- type MachineLSEDeploymentEntity
- type MachineLSEEntity
- type RackLSEEntity
- type SchedulingUnitEntity
- type VMEntity
Constants ¶
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 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 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 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 BatchGetVMs ¶
BatchGetVMs returns a batch of vms from datastore.
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 DeleteMachineLSE ¶
DeleteMachineLSE deletes the machineLSE in datastore
func DeleteMachineLSEs ¶
DeleteMachineLSEs deletes a batch of machine LSEs
func DeleteRackLSE ¶
DeleteRackLSE deletes the rackLSE in datastore
func DeleteSchedulingUnit ¶
DeleteSchedulingUnit deletes the SchedulingUnit in datastore.
func GetAllMachineLSEs ¶
GetAllMachineLSEs returns all machine lses in datastore.
func GetDeploymentIndexedFieldName ¶
GetDeploymentIndexedFieldName returns the index name
func GetMachineLSE ¶
GetMachineLSE returns machine for the given id from datastore.
func GetMachineLSEDeployment ¶
GetMachineLSEDeployment returns the deployment record for a given serial number
func GetMachineLSEIndexedFieldName ¶
GetMachineLSEIndexedFieldName 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 ImportMachineLSEs ¶
ImportMachineLSEs creates or updates a batch of machine lses in datastore
func ImportRackLSEs ¶
ImportRackLSEs creates or updates a batch of rack LSEs in datastore
func ListAllMachineLSEs ¶
ListAllMachineLSEs returns all machine lses in datastore.
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 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 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.
Types ¶
type MachineLSEDeploymentEntity ¶
type MachineLSEDeploymentEntity struct { 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.
type MachineLSEEntity ¶
type MachineLSEEntity struct { 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"` 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"` // 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.
type RackLSEEntity ¶
type RackLSEEntity struct { 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.
type SchedulingUnitEntity ¶
type SchedulingUnitEntity struct { 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.
type VMEntity ¶
type VMEntity struct { 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"` // Follow others entities, store ufspb.VM bytes. VM []byte `gae:",noindex"` // contains filtered or unexported fields }
VMEntity is a datastore entity that tracks VM.