inventory

package
Version: v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 61 Imported by: 0

Documentation

Overview

Package inventory implements the fleet.Inventory service end-points of corsskylabadmin.

Package inventory implements the fleet.Inventory service end-points of corsskylabadmin.

Package inventory implements the fleet.Inventory service end-points of corsskylabadmin.

Index

Constants

View Source
const (
	// DeviceConfigKind is the datastore entity kind for device config entities.
	DeviceConfigKind string = "DeviceConfig"
)

Variables

This section is empty.

Functions

func GetDeviceConfig

func GetDeviceConfig(ctx context.Context, gitilesC gitstore.GitilesClient) (map[string]*device.Config, error)

GetDeviceConfig fetch device configs from git.

func GetDutsByEnvironment

func GetDutsByEnvironment(ctx context.Context, s *gitstore.InventoryStore) ([]*inventory.DeviceUnderTest, error)

GetDutsByEnvironment returns Duts belong to a given environment.

func GetManufacturingConfig

func GetManufacturingConfig(ctx context.Context, gitilesC gitstore.GitilesClient) (map[string]*manufacturing.Config, error)

GetManufacturingConfig fetch manufacturing configs from git.

func SaveDeviceConfig

func SaveDeviceConfig(ctx context.Context, deviceConfigs map[string]*device.Config) error

SaveDeviceConfig save device configs to datastore for updateDutLabel check.

func UpdateLabelsWithDeviceConfig

func UpdateLabelsWithDeviceConfig(ctx context.Context, sl *inventory.SchedulableLabels) error

UpdateLabelsWithDeviceConfig update skylab inventory labels with cached device config.

Types

type DeviceConfigID

type DeviceConfigID struct {
	PlatformID string
	ModelID    string
	VariantID  string
}

DeviceConfigID includes required info to form a device config ID.

type GerritFactory

type GerritFactory func(c context.Context, host string) (gitstore.GerritClient, error)

GerritFactory is a contsructor for a GerritClient

type GitilesFactory

type GitilesFactory func(c context.Context, host string) (gitstore.GitilesClient, error)

GitilesFactory is a contsructor for a GerritClient

type ServerImpl

type ServerImpl struct {
	// GerritFactory is an optional factory function for creating gerrit client.
	//
	// If GerritFactory is nil, clients.NewGerritClient is used.
	GerritFactory GerritFactory

	// GitilesFactory is an optional factory function for creating gitiles client.
	//
	// If GitilesFactory is nil, clients.NewGitilesClient is used.
	GitilesFactory GitilesFactory

	// SwarmingFactory is an optional factory function for creating clients.
	//
	// If SwarmingFactory is nil, clients.NewSwarmingClient is used.
	SwarmingFactory SwarmingFactory

	// TrackerServerFactory is a required factory function for creating a tracker object.
	//
	// TODO(pprabhu) Move tracker/tasker to individual sub-packages and inject
	// dependencies directly (instead of factory functions).
	TrackerFactory TrackerFactory

	// StableVersionGitClientFactory
	StableVersionGitClientFactory StableVersionGitClientFactory
	// contains filtered or unexported fields
}

ServerImpl implements the fleet.InventoryServer interface.

func (*ServerImpl) AssignDutsToDrones

func (is *ServerImpl) AssignDutsToDrones(ctx context.Context, req *fleet.AssignDutsToDronesRequest) (resp *fleet.AssignDutsToDronesResponse, err error)

AssignDutsToDrones implements the method from fleet.InventoryServer interface.

func (*ServerImpl) BalancePools

func (is *ServerImpl) BalancePools(ctx context.Context, req *fleet.BalancePoolsRequest) (resp *fleet.BalancePoolsResponse, err error)

BalancePools implements the method from fleet.InventoryServer interface.

func (*ServerImpl) BatchUpdateDuts

func (is *ServerImpl) BatchUpdateDuts(ctx context.Context, req *fleet.BatchUpdateDutsRequest) (resp *fleet.BatchUpdateDutsResponse, err error)

BatchUpdateDuts implements the method from fleet.InventoryServer interface.

func (*ServerImpl) DeleteDuts

func (is *ServerImpl) DeleteDuts(ctx context.Context, req *fleet.DeleteDutsRequest) (resp *fleet.DeleteDutsResponse, err error)

DeleteDuts implements the method from fleet.InventoryServer interface.

func (*ServerImpl) DeployDut

func (is *ServerImpl) DeployDut(ctx context.Context, req *fleet.DeployDutRequest) (resp *fleet.DeployDutResponse, err error)

DeployDut implements the method from fleet.InventoryServer interface.

func (*ServerImpl) DumpStableVersionToDatastore

DumpStableVersionToDatastore takes stable version info from the git repo where it lives and dumps it to datastore

func (*ServerImpl) GetDeploymentStatus

func (is *ServerImpl) GetDeploymentStatus(ctx context.Context, req *fleet.GetDeploymentStatusRequest) (resp *fleet.GetDeploymentStatusResponse, err error)

GetDeploymentStatus implements the method from fleet.InventoryServer interface.

func (*ServerImpl) GetDroneConfig

func (is *ServerImpl) GetDroneConfig(ctx context.Context, req *fleet.GetDroneConfigRequest) (resp *fleet.GetDroneConfigResponse, err error)

GetDroneConfig implements the method from fleet.InventoryServer interface.

func (*ServerImpl) GetDutInfo

func (is *ServerImpl) GetDutInfo(ctx context.Context, req *fleet.GetDutInfoRequest) (resp *fleet.GetDutInfoResponse, err error)

GetDutInfo implements the method from fleet.InventoryServer interface. Deprecated: Do not use.

func (*ServerImpl) GetStableVersion

func (is *ServerImpl) GetStableVersion(ctx context.Context, req *fleet.GetStableVersionRequest) (resp *fleet.GetStableVersionResponse, err error)

GetStableVersion implements the method from fleet.InventoryServer interface

func (*ServerImpl) ListRemovedDuts

func (is *ServerImpl) ListRemovedDuts(ctx context.Context, req *fleet.ListRemovedDutsRequest) (resp *fleet.ListRemovedDutsResponse, err error)

ListRemovedDuts implements the method from fleet.InventoryServer interface.

func (*ServerImpl) ListServers

func (is *ServerImpl) ListServers(ctx context.Context, req *fleet.ListServersRequest) (resp *fleet.ListServersResponse, err error)

ListServers implements the method from fleet.InventoryServer interface.

func (*ServerImpl) PushInventoryToQueen

func (is *ServerImpl) PushInventoryToQueen(ctx context.Context, req *fleet.PushInventoryToQueenRequest) (resp *fleet.PushInventoryToQueenResponse, err error)

PushInventoryToQueen implements the method from fleet.InventoryServer interface.

This RPC is deprecated. The cron job is moved to InventoryV2[pushToDroneQueenCronHandler]. https://source.corp.google.com/chromium_infra/go/src/infra/appengine/cros/lab_inventory/app/cron/cron.go;l=312

func (*ServerImpl) RedeployDut

func (is *ServerImpl) RedeployDut(ctx context.Context, req *fleet.RedeployDutRequest) (resp *fleet.RedeployDutResponse, err error)

RedeployDut implements the method from fleet.InventoryServer interface.

func (*ServerImpl) RemoveDutsFromDrones

func (is *ServerImpl) RemoveDutsFromDrones(ctx context.Context, req *fleet.RemoveDutsFromDronesRequest) (resp *fleet.RemoveDutsFromDronesResponse, err error)

RemoveDutsFromDrones implements the method from fleet.InventoryServer interface.

func (*ServerImpl) ReportInventory

func (is *ServerImpl) ReportInventory(ctx context.Context, req *fleet.ReportInventoryRequest) (resp *fleet.ReportInventoryResponse, err error)

ReportInventory reports metrics of duts in inventory.

This method is deprecated. UFS reports the inventory metrics.

func (*ServerImpl) ResizePool

func (is *ServerImpl) ResizePool(ctx context.Context, req *fleet.ResizePoolRequest) (resp *fleet.ResizePoolResponse, err error)

ResizePool implements the method from fleet.InventoryServer interface.

func (*ServerImpl) UpdateCachedInventory

func (is *ServerImpl) UpdateCachedInventory(ctx context.Context, req *fleet.UpdateCachedInventoryRequest) (resp *fleet.UpdateCachedInventoryResponse, err error)

UpdateCachedInventory implements the method from fleet.InventoryServer interface.

func (*ServerImpl) UpdateDeviceConfig

func (is *ServerImpl) UpdateDeviceConfig(ctx context.Context, req *fleet.UpdateDeviceConfigRequest) (resp *fleet.UpdateDeviceConfigResponse, err error)

UpdateDeviceConfig implements updating device config to inventory.

func (*ServerImpl) UpdateDutLabels

func (is *ServerImpl) UpdateDutLabels(ctx context.Context, req *fleet.UpdateDutLabelsRequest) (resp *fleet.UpdateDutLabelsResponse, err error)

UpdateDutLabels implements the method from fleet.InventoryServer interface.

func (*ServerImpl) UpdateManufacturingConfig

func (is *ServerImpl) UpdateManufacturingConfig(ctx context.Context, req *fleet.UpdateManufacturingConfigRequest) (resp *fleet.UpdateManufacturingConfigResponse, err error)

UpdateManufacturingConfig backfill parts of manufacturing config to inventory V1.

type StableVersionGitClientFactory

type StableVersionGitClientFactory func(c context.Context) (git.ClientInterface, error)

StableVersionGitClientFactory is a constructor for a git client pointed at the source of truth for the stable version information

type SwarmingFactory

type SwarmingFactory func(c context.Context, host string) (clients.SwarmingClient, error)

SwarmingFactory is a constructor for a SwarmingClient.

type TrackerFactory

type TrackerFactory func() fleet.TrackerServer

TrackerFactory is a constructor for a TrackerServer object.

Jump to

Keyboard shortcuts

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